cancel
Showing results for 
Search instead for 
Did you mean: 

router Non-xml condition error as Invalid format of condition expression

ravi_nagarvwr
Explorer
0 Kudos

Hello Experts, Cloud Integration , SAP Integration Suite,

I have stored properties in content modifier and trying to apply NON-XML condition in router to check the length.

But its giving an error as Invalid format of condition expression.

Property as below:

  1. C4C_ContactID --> value from Xpath
  2. userId --> value from Xpath
( ${property.C4C_ContactID} = null or ${property.C4C_ContactID.trim().length()} = '0' ) and ( ${property.userId} = null or ${property.userId.trim().length()} = '0' )

Kindly help me to understand what is wrong in above condition.

Thanks,

Ravi

Accepted Solutions (0)

Answers (1)

Answers (1)

chris_75
Explorer

Hi Ravi,

you cannot combine multiple and / or operators in the same expression using parantheses.

I would suggest to use a small groovy script, check the C4C_ContactID and userId there and put the result in a property. After that, use this property in your router condition.

Best regards

Christian

ravi_nagarvwr
Explorer
0 Kudos

Thanks Chris for response. I thought I made some mistake in condition.

With Groovy Its working fine. 

import com.sap.gateway.ip.core.customdev.util.Message;
def Message processData(Message message)
{
   def propertyMap = message.getProperties();
    def userId = propertyMap.get("userId");
    def C4C_ContactID = propertyMap.get("C4C_ContactID");
    def result;
    if ((userId == null || userId.length() == 0) &&  (C4C_ContactID == null || C4C_ContactID.length() == 0)){
            result = "true"
            message.setProperty("result", result); }
    elseresult = "false"
            message.setProperty("result", result); }
return message;
}