Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 

This blog is based mostly on shoaib-alam's blog , based on what I did to set up a new environment from scratch in 2024, as some of the links and blogs were now outdated, and everything was spread over several blogs.. this blog will combine all in one.

Step 1: Find the correct version of Java, Groovy and Apache Camel

SAP Integration Suite runtime environment uses Java and Apache Camel integration framework.  It’s important to ensure that Java, Apache Camel and Groovy libraries versions that are used in SAP Integration Suite is in sync with those used in your IDE. If IDE is using a newer version of these libraries, then locally developed Groovy scripts are likely to fail at the SAP Integration Suite runtime.

A version of the Groovy library that is used in runtime can be identified with the help of the standard GDK API by calling the getVersion() method of the groovy.lang.GroovySystem class.

You can also find the Java version and Apache Camel version by calling the getProperty(String) method of the java.lang.System class and getVersion() method of CamelContext respectively.

Add a new Integration Flow, add Groovy Script Step, and add the following Groovy code:




import org.apache.camel.impl.*

def Message processData(Message message) {

        def camelContext = new DefaultCamelContext()
        StringBuilder versions = new StringBuilder()
        versions << "Groovy: ${GroovySystem.getVersion()}\n"
        versions << "Java: ${System.getProperty('java.version')}\n"
        versions << "Camel: ${camelContext.getVersion()}"
        return message





Add a timer, deploy, and use a trace in combination with CPI helper to get the result without effort

iFlow to get versions from CIiFlow to get versions from CI



version flow resultversion flow result

Step 2: Install Eclipse and Groovy Developer Tools

For this environment, I used the following versions:

Eclipse 2021-12 (4.22) For Java Developers
Download & install this Eclipse version

After Eclipse is installed - start Eclipse and install Groovy Developer Tools:
Go to 'Help' > 'Install New Software..'
Click 'Add..'
Enter 'Groovy Developer Tools' as name

You can also use a different version of Eclipse, as long as you set the project Java VM version to a Java 8 JDK.
If you used a different version of Eclipse, you can find a corresponding version of Groovy Developer Tools here: wiki

add new repository to Eclipse for Groovy Developer Toolsadd new repository to Eclipse for Groovy Developer Tools

Install the Main Package


Step 3: Get all the required jar files

This step involves another integration flow in Cloud Integration, to explore and download the files we need from Cloud Integration itself

You can either download the flow from here and import it: CI Filesystem
Or you can create it yourself with these instructions:


You need 2 integration processes, one endpoint to allow browsing, and one for viewing or downloading the files.

Create a script and paste in the following code:




import java.util.HashMap

def Message browse(Message message) {
    def mapHeaders = message.getHeaders()
    String mainDir = mapHeaders.get("CamelHttpPath") 
    String mainUrl = mapHeaders.get("CamelHttpUrl") 
    String mainSrv = mapHeaders.get("CamelServletContextPath")
    String srvUrl  = mainUrl.minus(mainDir)
    String urlDown = srvUrl.minus(mainSrv)+"/amba/cpifilesystemdownload"
    File dir = new File(mainDir)
    StringBuilder strBuilder = new StringBuilder()
    strBuilder << '<meta charset="UTF-8"></br>'
    if (dir.parent != null){strBuilder << "<a href='${srvUrl}${dir.parent}'>&#x1F4C1 ..</a></br>"}
    dir.eachDir {strBuilder << "<a href='${mainUrl}/${}'>&#x1F4C1 ${}</a></br>"}
    dir.eachFile {if (it.isFile()) {strBuilder << "<a href='${urlDown}/${mainDir}/${}'>${}</a></br>" }}
    mapHeaders = ['content-type':'text/html']
    return message

def Message download(Message message) {
    def mapHeaders = message.getHeaders()
    String filePath = mapHeaders.get("CamelHttpPath") 
    StringBuilder strBuilder = new StringBuilder()
    File file = new File(filePath);byte[] fileContent = file.bytes
    strBuilder << fileContent.encodeBase64().toString()    
    mapHeaders = ['Content-Transfer-Encoding':'base64',
                  'Content-Disposition':'attachment; filename=${file.getName()}']
    return message




For browsing use this https endpoint address: /amba/cpifilesystem*


Add a script block with the groovy script calling the browse function from the script


For downloading use this https endpoint address: /amba/cpifilesystemdownload*


Add a script block with the groovy script calling the download function from the script


Also add a Base64 Decoder to the download process

Now deploy and go to and download the war file stack.worker_cf.karaf-6.xx.x.war. Unzip this file in a new! directory and it will provide most of the required jars.

Now also download slf4j-api-2.0.11.jar and slf4j-simple-2.0.9.jar from the maven repository here

Final Step 4: Create a Groovy testing project

Create a new Groovy project


Make sure you add a Java 8 JDK to use as JRE, and make that the default JRE, like Zulu 8

You can go to the properties of the JRE System Library, add the Java 8 JDK and then make it the default JRE


You will also need to add all the jars that you have downloaded earlier to the project
To do so, richt click the project folder > click on 'Build Path' > 'Configure Build Path...'


This will be easiest if you first create a new folder and move or copy all the following jars to it


  • slf4j-api-2.0.11.jar
  • slf4j-simple-2.0.9.jar

Now over in Eclipse, in the build path window, go to the 'Libraries' tab, click on Add External JARs... and add all the jars I listed earlier.


Now you can do the last steps, creating the actual Groovy script files

New > create a Groovy Type file


You can call it 'GroovyCPITest', kind Script


Paste in the script file the following contents, which will allow to run the other script as a script or Groovy shell


package com.groovy.testing


// Load Groovy Script
GroovyShell shell = new GroovyShell()
def script = shell.parse(new File("src/com/groovy/testing/script1.groovy"))

// Initialize message with body, header and property
Message msg = new MessageImpl()
msg.setBody(new String("Hello Groovy World"))
msg.setHeader("oldHeader", "MyGroovyHeader")
msg.setProperty("oldProperty", "MyGroovyProperty")

// Execute script

// Display results of script in console
println("Body:\r\n" + msg.getBody())

def displayMaps = { String mapName, Map map ->
	println mapName
	map.each { key, value -> println( key + " = " + value) }
displayMaps("Headers:", msg.getHeaders())
displayMaps("Properties:", msg.getProperties())


And also a second time for a script called 'script1'

Here you can paste your own Groovy script that you want to test/debug. For this example, I used the default contents that SAP puts in a new Groovy script file.

That was finally all, you can now run/debug the script by right clicking the project > Run As/Debug As > Groovy Console/Groovy Shell





Labels in this area