More Fun with SAP Cloud Integration and Camel’s Simple Expressions

Hello fellow Integrators,

there is a great article from Morten Wittrock about what’s possible in Camel’s Simple expression language. I was wondering if it would be possible to access maps and lists via simple expressions. That might come in pretty handy. If you want to read more blog posts and news about SAP Cloud Integration, follow the Kangoolution LinkedIn page.

But let’s get our hands dirty and create a simple IFlow to try it.

It took some attempts but the results seem pretty promising. First we create a map and a list in Groovy:

def Message processData(Message message) {
    def animalsList = ["dog","cat","horse", "cow"]
    def countryMap = ["DE":"Germany","AT":"Austria", "IN":"India"]

    message.setProperty("animalsList", animalsList);
    message.setProperty("countryMap", countryMap);
    return message;

Now we add some expressions to the Content Modifier:


get the size of a list

get element

get last element

get element before last element

get last element in upper case


get map element

get map size

check if map contains element

Deploy and check results with CPI Helper Plugin for Chrome and Edge:

I will definitely use this in future developments.

Unfortunately, there seems to be no way to pop elements from lists for example. In case you find a solution or if you have other interesting camel expressions, please write a comment.


Dominic Beckbauer

Ein Gedanke zu „More Fun with SAP Cloud Integration and Camel’s Simple Expressions

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert