The MSPro Boomi Collection
About
ScriptEase For Boomi
ScriptEase For Boomi
  • ScriptEase
    • ScriptEase Development Environment
    • What AI says!
      • The limits of AI ...
  • Software Installation
    • Install a local Atom
  • Project Setup
    • IntelliJ Configuration
    • Verify Project Setup
  • Concepts
    • Use Test Data
  • Examples
    • 1 - Debug an existing process script
    • 9 - Aggregate Prices Example
  • Test Contexts
    • The Process Call Chain
  • Download
  • 💤Appendix
    • Script Templates
    • Java thoughts and recommendations
      • Chose newer JVM for local development
    • Boomi documentation and links
    • Initialize IntelliJ Templates
    • Script Contexts
  • Troubleshoot
    • Java the weed
    • ClassNotFoundException - GroovyStarter
    • Invalid VCS root mapping
    • An illegal reflective access operation has occurred
    • UnauthorizedAccess Error
  • Licensing
    • License Activation
    • Privacy Policy
Powered by GitBook
On this page
  1. Examples

1 - Debug an existing process script

Last updated 6 months ago

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.

IntelliJ gives us some warnings (yellow bars to the right): Unused Imports and Unnecessary Semicolon - fix it, or leave it. Just to mention here that you eventually want to read and recognize what IntelliJ tells you.

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:

Tip!

Project Files Bar -> Options (three dots) -> Appearance -> View Excluded Files

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?

The MyScripts IntelliJ project comes with , to create new Tests and Scripts. If you have

enabled, you will see the files in the project directory under .idea\fileTemplates. More information on that topic in the .

four pre-configured templates
IntelliJ Help
create a new package
Boomi Integration - Process Script with Null functionality
psgNull pasted into IntelliJ, with warnings
Null script with breakpoint
Create a test from a template: the test needs the name of the script.
Haltet script