You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am facing parsing error when field name in expression is having hyphen sign.
Example expression - field-plus+field-minus
variables - field-plus and field-minus
Objective - I want to perform addition of these 2 variables.
My code
Map<String, Double> map = new HashMap<>();
map.put("field-plus", 5d);
map.put("field-minus", 10d);
Expression e = new ExpressionBuilder("field-plus+field-minus" )
.variables("field-plus","field-minus")
.build()
.setVariables(map);
double result = e.evaluate();
Its throwing - Unknown function or variable 'field' at pos 0 in expression 'field-plus+field-minus'
I have also tried option to use single quote character in expression like "'field-plus'+'field-minus'" and setting variable with single quote but still it gives error to parse single quote character.
Is there any other way to achieve my goal ? If its a defect , is there any plan to fix it ?
Please suggest.
Thanks,
Neeraj.
The text was updated successfully, but these errors were encountered:
Hi,
I am facing parsing error when field name in expression is having hyphen sign.
Example expression - field-plus+field-minus
variables - field-plus and field-minus
Objective - I want to perform addition of these 2 variables.
My code
Map<String, Double> map = new HashMap<>();
map.put("field-plus", 5d);
map.put("field-minus", 10d);
Expression e = new ExpressionBuilder("field-plus+field-minus" )
.variables("field-plus","field-minus")
.build()
.setVariables(map);
double result = e.evaluate();
Its throwing - Unknown function or variable 'field' at pos 0 in expression 'field-plus+field-minus'
I have also tried option to use single quote character in expression like "'field-plus'+'field-minus'" and setting variable with single quote but still it gives error to parse single quote character.
Is there any other way to achieve my goal ? If its a defect , is there any plan to fix it ?
Please suggest.
Thanks,
Neeraj.
The text was updated successfully, but these errors were encountered: