camunda / feel-scala

FEEL parser and interpreter written in Scala
https://camunda.github.io/feel-scala/
Apache License 2.0
123 stars 50 forks source link

The access of a non-existing property should return null #707

Closed saig0 closed 1 year ago

saig0 commented 1 year ago

Describe the bug If I access a non-existing property of value (e.g. the seconds of a years and months duration), the engine returns a failure. But it should be more friendly and return null instead.

To Reproduce Steps to reproduce the behavior:

  1. Evaluate the following expression
    @"P1Y".seconds
  2. Verify that the engine returns a failure:
    failed to evaluate expression '@"P1Y".seconds': No property found with name 'seconds' of value 'P1Y'. Available properties: years,months

Expected behavior According to the DMN spec, the access of a non-existing property should return null.

Screenshot from 2023-09-08 14-19-44

(DMN 1.5, chapter 10.3.2.15, page 133)

Environment