Reputation: 12682
How to reference a flow variable in an expression filter?
Assuming that myVariable
is a boolean, I tried:
<expression-filter evaluator="variable" expression="myVariable" />
but that did not work. Eventually I settled for:
<expression-filter evaluator="groovy" expression="message.getInvocationProperty('myVariable')" />
Thanks
Upvotes: 0
Views: 2550
Reputation: 33413
The variable expression is not complete and can't be evaluated to a boolean as is (while the Groovy probably can because the variable is a boolean).
You need to specify an expected value :
<expression-filter evaluator="variable" expression="myVariable=true" />
The following should work too:
<expression-filter evaluator="header" expression="INVOCATION:myVariable=true" />
Upvotes: 1