camunda/feel-scala

Comparing different types should return null

Closed this issue · 0 comments

saig0 commented

Describe the bug
If I compare two values of a different type, the engine returns a failure. But it should be more friendly and return null instead.

This applies to expressions with the following operators: =, !=, <, >, etc.
And, this applies to unary-test expressions if the input value has a different type as the other value.

To Reproduce
Steps to reproduce the behavior:

  1. Evaluate the following expression
"foo" = 100
  1. Verify that the engine returns a failure:
failed to evaluate expression '"foo" = 100': expected String but found 'ValNumber(100)'

Expected behavior
According to the DMN spec, the comparison of different types should return null.

Screenshot from 2023-09-08 14-33-47

(DMN 1.5, chapter 10.3.2.2, page 105)

Environment

  • FEEL engine version: 1.16
  • Affects:
    • Camunda Automation Platform 7: [7.x]
    • Zeebe broker: [0.x]