Expressions in DMN Input Entry

Camunda’s documentation encourages using expressions on DMN input entry: DMN Decision Table Rule | docs.camunda.org.

But there is attached sample that works fine in Camunda 7.14.0 but fails in 7.16.0: test1.dmn (2.5 KB)

Rest request to evaluate endpoint:

{
    "variables": {
        "a1": {"value": 4, "type": "Integer"}
    }
}

Response in Camunda 7.14.0:

[
    {
        "r1": {
            "type": "Double",
            "value": 16.0,
            "valueInfo": {}
        }
    }
]

Response in Camunda 7.16.0:

{
    "type": "RestException",
    "message": "Cannot evaluate decision test1:1:d2a92733-4068-11ec-95bc-0242ac110002: Exception while evaluating decision with key 'null'"
}

Error in Camunda log:

Caused by: org.camunda.bpm.dmn.feel.impl.FeelException: FEEL/SCALA-01008 Error while evaluating expression: failed to parse expression 'b1 + (b1) >0': Expected ("," | end-of-input):1:4, found "+ (b1) >0"```

Is it Camunda's bug or incorrect DMN?

Hi @ValdisProdnieks,

thank you for reporting. This is a bug in the FEEL engine, probably Allow unary-tests without braces by saig0 · Pull Request #306 · camunda/feel-scala · GitHub. It is fixed in the latest version.

You can mitigate the bug by using parentheses in the expression.

(b1 + (b1) >0)

Does this help you?

Best regards,
Philipp

1 Like

thanks. It helps.