-
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
Handle non-existing variables and context entries gracefully in comparison and filter expressions #582
Comments
Related to the issue dmn-tck/tck#536 that points to the following section of the DMN spec: |
I have a question about this topic: We have an implementation that validates the expression (if the expression is valid and if the variables exist in the context) in standalone way and we use FeelEngine (evalUnaryTests or evalExpression) to do it, but today FeelEngine doesn't fail, it just emits a log warn level. When we run the complete DMN (when we put expression in DMN and run Camunda), the evaluate of the expression fails, because the variable does not exist. Wouldn't it be better to have the same result in both cases? I use Camunda Platform 7.17 (DMN 7.17 too) |
Yes. The FEEL engine should behave the same. However, the DMN (or BPMN) engine may raise an error (or incident) if the expression doesn't return a required value. It would be great if you could share your example. Happy to discuss it in detail. |
@saig0, the ZPA team would like to work on this together with you. Do you think you would have time for that, or is there any way we can clarify what needs to happen here? |
@korthout awesome. Let's schedule a pair/mob programming session (but not before 2023-04-24). We should plan for at least 2 hours of coding. |
@saig0 I'll be unavailable for about two weeks starting April 26th. You may need to organize this with the team, or someone else from @camunda/zeebe-process-automation needs to arrange this. |
The expected behavior is now clarified. There is a new TCK test case for it. |
That's great! Perhaps we can tackle this in the first mob programming session after the retreat. //cc @remcowesterhoud |
For example:
Side note: The DMN spec says that |
The team spend time on this during our weekly mob programming session, resulting in: We'll continue it again next week |
Moving this back to Ready, as there is one step left:
|
Describe the bug
If I compare a non-existing variable with a value then the expression fails. To avoid failure, I must do a null check first.
The behavior is the same for filter expressions.
Related discussion.
Related to #572.
Related to #260.
To Reproduce
Steps to reproduce the behavior:
x = 5
Expected behavior
A non-existing variable or context entry is handled gracefully in a comparison and a filter.
Instead of failing the evaluation, the comparison or filter handles the non-existing value as
null
. The comparison may returnfalse
ornull
. The filter doesn't include the list item in the result.Since the engine handles the case gracefully, no warning should be printed.
Environment
1.15.2
The text was updated successfully, but these errors were encountered: