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

FEEL Engine fails to evaluate expression "keyword myVariable keyword myFunction()"

XMLWordPrintable

      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 myVariable keyword myFunction() fails.

      Steps to reproduce (Required on creation):

      Evaluate the following expression to reproduce the problem:

      eval("if 7 > var then flatten(xs) else []", Map("xs" -> List(1, 2), "var" -> 3))

      Observed Behavior (Required on creation):

      The following error is shown:
      ValError(no function found with name 'myVariable keyword myFunction' and 1 parameters).

      Expected behavior (Required on creation):

      The expression has the following return value:

      ValList(List(ValNumber(1), ValNumber(2)))

      Root Cause (Required on prioritization):

      The keywords satisfies, return, then, and else are not defined as reserved keywords.

      Solution Ideas (Optional):

      1. Wrap the variable into parentheses
      2. Fix the bug in the FEEL Engine by adding the keywords satisfies, return, then, and else to the list of reserved keywords: https://github.com/camunda/feel-scala/blob/d538af/src/main/scala/org/camunda/feel/impl/parser/FeelParser.scala#L139-L148
        • 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):

      I've already raised a pull request to fix the problem:
      https://github.com/camunda/feel-scala/pull/395

        This is the controller panel for Smart Panels app

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

                Created:
                Updated:
                Resolved: