-
Notifications
You must be signed in to change notification settings - Fork 51
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
FEEL Expression evaluates to null, instead of ignoring missing element in JSON #572
Comments
The underlying issue is that the expression This case is not mentioned explicitly in the DMN specification. But it mentions that the access of the context entries by their key is only a shortcut. So, the expression could be also written as The expression Workaround
It used the get value() function that returns either the value of the given key or |
After a discussion, we agreed that it could make sense to handle non-existing variables or context entries gracefully in comparisons and filter expressions. As a result, the filter expression would ignore the missing property and return only the matching entries. |
We have a confirmation that the filter should ignore the element without the property and should return the other elements that match the filter. See here: #582 (comment). |
Closing this issue in favor of #582. Both issues are about the same problem. |
Describe the bug
A FEEL Expression to count the number of times a specific key, value pair occurs in a JSON input, returns
null
, when the filtered key is missing in the input.To Reproduce
can be reproduced in the playground - https://camunda.github.io/feel-scala/docs/playground/
Input JSON :
FEEL Expression -
Here, with the above JSON, the value of OneCount is 4, but the value of twoCount is NULL
Expected behavior
Ideally, the value of twoCount should be 3, since the property "two" appears 3 times in the input.
Environment
The text was updated successfully, but these errors were encountered: