My property file values are:
companies = test
companies1 =
companies2 = 'another'
now if I have a MEL validation like below doesn't work.
<choice doc:name = "PageNum-1">
<when expression = "#[ ${companies} != '' ]">
<logger message = "===== Nothing to execute in process 1 ===" level="INFO" doc:name = "Logger"/>
</when>
<otherwise>
<logger message = "===== Nothing to execute in process 0 ===" level="INFO" doc:name = "Logger"/>
</otherwise>
</choice>
Error:
Exception stack is:
1. [Error: illegal use of operator: !=]
[Near : {... !='' ....}]
^
[Line: 1, Column: 1] (org.mule.mvel2.CompileException)
EDIT:
As a workaround solution, I have added a flow variable and verifying the data in expression as
<set-variable variableName = "company1" value = "${companies1}" doc:name = "company1"/>
<when expression = "#[flowVars.company1.isEmpty()]">
But, is there any simpler way to do with only by using $ as ${commpany1}