1 - Debug an existing process script
We are creating a new, empty script file in our project. Then we copy and paste the code of an existing process script into the file. We create a Test to host the script, and we debug the existing script with IntelliJ.
Right click on training and select New -> Package, aka: new folder.

Call the package: training.example01 . Right click on example01`  and add a new, blank Groovy Script. Call it psgNull - null: it does nothing, no functionality!

Goto to Boomi Integration and create a new Process Script, call it psgNull

import java.util.Properties;
import java.io.InputStream;
for( int i = 0; i < dataContext.getDataCount(); i++ ) {
    InputStream is = dataContext.getStream(i);
    Properties props = dataContext.getProperties(i);
    dataContext.storeStream(is, props);
}Copy the code and paste it into the psgNull.groovy file.

Set a breakpoint on line 8, we want to stop there:

Now, we want to debug that script, and we need a Test as a host to run the process script locally.
Create Test class from template
Right click on the example01 folder select New -> Boomi Process Script Test and provide the Map-Script name (from above: psgNull) without psg:

Open  the created Test_Null, click the green arrow and Debug method test01().

The code execution is going to halt in the debugger in our Boomi Script psgNull.groovyon line 8.

Select dataContext.getDataCount(), right click and Evaluate Expression... to see the data: value = 1.
Big question: A value of 1 means, the script has got one document! The question is, where did it come from?
Last updated