Details
Description
Environment (Required on creation):
- This is a regression introduced with FEEL Scala Engine version 1.14.0
- The C7 engine uses FEEL Scala Engine version 1.12.4 and 1.13.3
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):
The evaluation of an expression structured as x and (y) fails.
Steps to reproduce (Required on creation):
Evaluate the following expression to reproduce the problem:
feel("x or (y)", Map("x" -> true, "y" -> false))
Observed Behavior (Required on creation):
The following error is shown:
failed to evaluate expression ' x and (y) ': no function found with name 'x and' and 1 parameters
Expected behavior (Required on creation):
The expression is parsed as conjunction/disjunction, instead of a function call, and it can be evaluated.
Root Cause (Required on prioritization):
- and/or were missing from the list of the reserved keywords
- After adding them, the parser doesn't recognize the built-in functions "and" | "or" | "date and time" | "month and year duration" since they contain a reserved keyword
Solution Ideas (Optional):
- Wrap the logical expression before the function call into parentheses
- Instead of x and y and count(z) > 0, use (x and y) and count(z) > 0
- In the parser, whitelist built-in function names that contain and/or to be handled as proper functions in FeelParser#functionInvocation
- Release a patch of the FEEL Engine
- Override/replace the FEEL Engine with version 1.14.2 (not released yet) manually by using the shaded artifact feel-engine-$VERSION-scala-shaded.jar
- In C7, bump the FEEL Engine version to 1.14.2 (not released yet) and release a patch
- Release a patch of the FEEL Engine
Hints (optional):
-
mgm-controller-panel
This is the controller panel for Smart Panels app
Attachments
Issue Links
- causes
-
CAM-14356 Bump FEEL Scala Engine to >= 1.14.2
- Closed
- links to