I have a variable having some numeric value x = 5;
.
I want to right an expression like:
if arr = [4,7,10]
contains x
in mvel.
Is that possible, if yes, how ?
As of now I will have to right expression as :
x == 4 || x == 7 || x == 10
but since i may have a big list can this be made something like
x in [4,7,10,...]
Code :
for(Rule rule: ruleList)
{
String expresssion = rule.getConditionExpression();
boolean result = (Boolean) expressionHandler.execute(expresssion,ruleEvalData);
}
Here expression will be like :
expression = 'x == 4 || x == 7 || x == 10';
and ruleEvalData will have x in it.
I want to know if
expression ='x in [4,7,10,...]' is possible in MVEL ?