cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic router condition in sap cpi

pmhatre12
Explorer
0 Kudos

hello
i want to create dynamic router condition in cpi . pd property store in header and employee_id store in exchange property . i tried with multiple way but still getting same error.

Accepted Solutions (0)

Answers (1)

Answers (1)

MortenWittrock
Active Contributor
0 Kudos

Hi Pranita

The right-hand side of the comparison cannot be another Simple expression language expression, unfortunately.

Your alternative is to do the comparison in a script, store the result in a property and then branch on the contents of that property. Something like this:

import com.sap.gateway.ip.core.customdev.util.Message

def Message processData(Message message) {
def headerVal = message.getHeaders().get('pd')
def propVal = message.getProperty('EMPLOYEE_ID')
message.setProperty('EqualsResult', headerVal.equals(propVal).toString())
return message
}

After the script step, the property EqualsResult will then either contain "true" or "false".

Regards,

Morten