0
votes
<logger message="id is===#[flowVars.fein.contains(flowVars.clientId)]===" level="INFO" doc:name="Logger"/>
<logger message="compare id is===#[flowVars.fein.contains('12-345678')]===" level="INFO" doc:name="Logger"/>

This works fine for me i.e it verifies string comparision and returns the Boolean values. Now if my input contains values with appended |,(eg:,12-345678|22-345678|33-345678) how do I compare it?

In Java it is : new ArrayList<String>(Arrays.asList(s.split("\\|"))).contains(inputValues); which will return the true/false.

2

2 Answers

2
votes

Not sure exactly what you are trying to achieve but you can use the same Java expression in MEL:

#[Arrays.asList(flowVars.fein.split('\\|')).contains('12-345678')]

There's also regex and wildcard functions that can provide more complex String comparison: https://developer.mulesoft.com/docs/display/current/Mule+Expression+Language+Reference#MuleExpressionLanguageReference-wildcard

Or you can take advantage of MVELs projections and folds maybe:

#[($ in flowVars.fein.split("\\|")).contains(inputValues)]
-2
votes

In MuleSoft you can use any java code by a component named EXPRESSION.