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

I can use a unary-test as a list filter #984

Open
mdouaihy opened this issue Feb 5, 2025 · 2 comments
Open

I can use a unary-test as a list filter #984

mdouaihy opened this issue Feb 5, 2025 · 2 comments

Comments

@mdouaihy
Copy link

mdouaihy commented Feb 5, 2025

The FEEL expression [1, 2, 3][>1] is expected to returns [2, 3]. Instead, it's returning []

The issue can be observed using the Playground running version 1.19.1 of the engine
https://camunda.github.io/feel-scala/docs/playground/?expression-type=expression

For information, the playground is reporting the below warnings

[NO_VARIABLE_FOUND] No input value found.
[NOT_COMPARABLE] Can't compare 'null' with '1'
[NO_VARIABLE_FOUND] No input value found.
[NOT_COMPARABLE] Can't compare 'null' with '1'
[NO_VARIABLE_FOUND] No input value found.
[NOT_COMPARABLE] Can't compare 'null' with '1'
[NO_VARIABLE_FOUND] No input value found.
[NOT_COMPARABLE] Can't compare 'null' with '1'

@mdouaihy
Copy link
Author

mdouaihy commented Feb 5, 2025

According to the document, https://www.omg.org/spec/DMN/1.5/PDF

  • we have the grammar rule 50. filter expression = expression , "[" , expression , "]" ; in the section 10.3.1.2 Grammar rules
  • and we have an The expression in square brackets can reference a list element using the name item, in the section 10.3.2.5 Lists and filters

Other implementations support the synthax [1, 2, 3][>1].

@saig0
Copy link
Member

saig0 commented Feb 6, 2025

@mdouaihy thank you for reporting. 👍 I agree that the grammar allows a unary-test in the list filter expression. However, I don't see that this case is mentioned explicitly in the specification.

Do you see a reference for the evaluation in the specification?
Do you see a related test case in the DMN TCK?


The issue is related to camunda/camunda#27458.

The FEEL JS engine evaluates the expression as expected: FEEL JS Playground

@saig0 saig0 changed the title A filtered list is returning an empty list I can use a unary-test as a list filter Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants