title: How to break beanshell script (In Jmeter) into functions & call them?
body: <p>Here below are my scenario:</p>
  
  <p>I am using JMeter to generate loads
  I have to read multiple .csv files and extracting values, then add some logic to it and then pass this data to Java functions (we have a jars files for that)
  I am using a BeanShell script. But I don't want to write all the code into one file. As file become a very big and hard to maintain.</p>
  
  <p>Query: Is there any way to write these functions in multiple beanshell script?
  Query: Is that possible to call these function written in different beanshell scripts?</p>
  
  <p>Can you provide a sample code for this?</p>
  
  <h2>This is what I am trying to do, below code is just for an example:</h2>
  
  <p>In 1st beanshell file, I defined a function</p>
  
  <pre><code>int sum (int a, int b)
  {
        return a+b;
  }
  </code></pre>
  
  <p>In 2nd beanshell file I want to call this function</p>
  
  <pre><code>int j = sum(2,3);
  log.info("sum-------------"+j);
  </code></pre>