-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[kie-issues#1841] Date and time related functions as non literal not permitted #6395
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enforces DMN 1.6 rules for range endpoints by allowing only date/time built‐in functions (without nested calls) or literals, and updates tests accordingly.
- Introduces
isAllowedFunctionInvocationNode
to restrict FunctionInvocationNode endpoints - Refactors
ALLOWED_NODES
andALLOWED_TYPES
to useSet
and updatesRangeFunction
logic - Revises
RangeFunctionTest
data and assertions to cover date/time functions and literals
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/RangeFunction.java | Adds isAllowedFunctionInvocationNode , switches allowed node/type lists to sets, refactors parsing logic |
kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/functions/RangeFunctionTest.java | Updates test cases for valid/invalid endpoints, refactors test data arrays |
Comments suppressed due to low confidence (1)
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/functions/RangeFunctionTest.java:565
- Syntax error: the second string literal is missing a closing parenthesis and quote. It should be
"duration(\"P2Y6M\")"
.
{"duration(\"P1Y6M\")", "duration(\"P2Y6M\""},
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/functions/RangeFunctionTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx - LGTM!
Closes apache/incubator-kie-issues#1841
According to the DMN 1.6 Specs:
In this PR: