How do Debug and manage SAP CPI Groovy scripts

CPIcourse Debug SAP CPI Groovy scripts.jpg


Managing your SAP CPI Groovy scripts and getting a good way to develop in them is not a trivial task. In this post, I'm looking at how you can use the Figaf tool to manage the process. 

This post is a cross post from

During my last webinar, I showed how it was possible to take your SAP CPI content and place it in Git repository. From this Git repository, we could create test cases and enable you to debug the scripts. I promised to show how you could get to debug your scripts. The demo is only 22 minutes, so it is not something that takes a long time.

One of the challenges with Groovy development is that you need to be really good a figuring out how to create an environment where you can run and edit your code. Most integration develops has not spent a lot of years on setting up Java build environments. That is why I asked my Java team about making it really easy to get to run the SAP CPI content and we have created this solution.

In the video I show how you :

  • Create a Git repository with all your SAP CPI iflows
  • How you use the built-in templates to configure all the Gradle plugins so you can interact with the SAP CPI system from your IDE. I’m using IntelliJ but it should also be possible with Eclipse or what you like to use. You just need to have Gradle and Groovy support.
  • How you enable your scripts to be run just by adding the SAP java API libs.
  • We should you can edit a script and deploy it to the CPI system
  • We show how you can create test cases for an SAP CPI Iflow.
  • Then we take this test data and creates test cases we can use to run our iflows with
  • Take the test cases and run your iflows with that content

The requirement we currently only support CPI on NEO, and only with S-user authentication.

Before you start this you need to download and install the Figaf DevOps. It is pretty simple. Just click the “Try Figaf DevOps Tool” on the Figaf site and signup. Then you will get information on how to download and run the Figaf tool. You can in most cases use your own S-User for the CPI connection and you can run the tool on your own landscape.

I hope you want to try of the Figaf tool and try to see how easy you can create your Groovy Scripts.

How does it compare to real SAP CPI

We have created our own implementations based on the SAP CPI documented libraries and compared with the camel implmetation. There is most likely some small differences if you look at really specific functions. There may also be different implementations we dont have like keystore or value mapping. We may add them at some point in time if requested by customers.

To run the test the tool sends text representations of your payloads. If you in your properties or header has some binary objects they will just be seen as a string point to the object. To avoid this use ${bodyAs(String)} once you are moving data to properties. Then the payload will be saved as a String. It may not be optimal for productive use.

Try Figaf DevOps

You can always just signup for the trial of the Figaf tool and then continue to use the Git repository for your development after the 30 days. If you don’t that the tool adds enough value.


There are no comments yet. Be the first one to leave a comment!