Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-14344

FEEL Engine: Expression with conjunction/disjunction (and/or) fails if it contains parentheses




      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):

      1. 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
      2. 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
          1. 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
          2. In C7, bump the FEEL Engine version to 1.14.2 (not released yet) and release a patch

      Hints (optional):



        This is the controller panel for Smart Panels app




              tassilo.weidner Tassilo Weidner
              tassilo.weidner Tassilo Weidner
              Tassilo Weidner Tassilo Weidner
              0 Vote for this issue
              1 Start watching this issue