Boomi Groovy Debugger in Eclipse

Discussion created by hoover1980 on Oct 24, 2017
Latest reply on Jul 11, 2018 by emily.klassen



Do you want to debug some simple groovy scripts without remote debugging, copy paste etc.

I created a simple Eclipse project that mocks the datacontext used by groovy scripts in the data process shape.

It uses datafiles from a directory (like XML) and processes them as a stream, just like Boomi.  You can put multiple files in this directory and add Properties to each document.


0.    Import the project into Eclipse and open the debug class located in nl.Boomi.GroovyDebugger.Main

1.    Set the correct directory in the path string.

2.    Add one or more properties for each file/stream using dataContext.addPropertyValues(i,"Key" , "Value");


3. Add your custom groovy code to the BoomiLogic() method.



I added this sample code in the boomiLogic method so you have a working sample.

This sample uses a reference to the JDOM.jar library, but you could add any java library you like.


4.    Set your breakpoints in the BoomiLogic method and press F11 to debug.

5.     Happy coding and debugging.


Take note that I've only tested XML files and mocked just the basics of the dataContext.

Stuff like ExecutionUtil and logger are absent. The only purpose of this tool is to be able to do some simple debugging.

It does not use any external library except for JDOM, which is included. You should be able to run it on any machine using eclipse. (https://spring.io/tools/ggts).


Edit:  I've added a new version. See my comment below