Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle non-existing variables and context entries gracefully #674

Closed
saig0 opened this issue Jul 6, 2023 · 1 comment · Fixed by #705
Closed

Handle non-existing variables and context entries gracefully #674

saig0 opened this issue Jul 6, 2023 · 1 comment · Fixed by #705
Assignees
Labels
scope: Camunda 8 Required in the context of Camunda 8 target:8.3 Planned for the Camunda 8.3 release type: bug

Comments

@saig0
Copy link
Member

saig0 commented Jul 6, 2023

Describe the bug
If I access a non-existing variable then the expression fails. To avoid failure, I must do a null check first.

x
// failed to evaluate expression 'x': no variable found for name 'x'

The behavior is the same for path expressions. If I access a non-existing context entry, the expression fails.

{a: 1}.b
// failed to evaluate expression '{a: 1}.b': context contains no entry with key 'b'

Related to #540.
Related to #582.

To Reproduce
Steps to reproduce the behavior:

  1. Evaluate the expression x
  2. Verify that the expression fails to evaluate

Expected behavior
The expression should return null if a variable or a context entry doesn't exist.

x = null

{a: 1}.b = null

{a: 1}.b.c = null

null.b = null

If the path expression is applied to a filter and a context doesn't contain the entry, the resulting list should contain null for this item.

// non-member path filtering
[ { x: 1 }, { y: 2 } ].y = [ null, 2 ]

[ { x: 1 } ].y = [ null ]

The expected behavior is aligned with the DMN spec. It is verified by the TCK test cases:

Environment

  • FEEL engine version: 1.16.0
  • Affects:
    • Camunda Automation Platform 7: [7.x]
    • Zeebe broker: [0.x]
@korthout
Copy link
Member

korthout commented Aug 2, 2023

ZPA triage:

  • good issue for an upcoming mob programming session
  • should be resolved before 8.3
  • sizing as medium as it takes the team some time to resolve such issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: Camunda 8 Required in the context of Camunda 8 target:8.3 Planned for the Camunda 8.3 release type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants