-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[incubator-kie-issues#1742] DMN: B-FEEL implementation #6213
Conversation
…atic methods. Add usage of FEELDialect inside BaseFEELTest
…1659 # Conflicts: # kie-dmn/kie-dmn-core-jsr223/src/main/java/org/kie/dmn/core/jsr223/JSR223DTExpressionEvaluator.java # kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/DMNFEELHelper.java # kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextFEELCtxWrapperTest.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/Functions.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/extended/RangeFunction.java # kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/codegen/feel11/CodegenTestUtil.java # kie-dmn/kie-dmn-legacy-tests/src/test/java/org/kie/dmn/legacy/tests/core/v1_1/DMNCompilerTest.java # kie-dmn/kie-dmn-openapi/src/main/java/org/kie/dmn/openapi/impl/BaseNodeSchemaMapper.java # kie-dmn/kie-dmn-openapi/src/main/java/org/kie/dmn/openapi/impl/MapperHelper.java
…r other refactoring (incubator-kie-issues#1206)
…1659 # Conflicts: # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSemanticMappings.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSupport.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/Expressions.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/FEELFunction.java # kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/codegen/feel11/ManualFilterTest.java # kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/codegen/feel11/ManualQuantTest.java # kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/codegen/feel11/ManualUnaryTestsTest.java
…spend to refactor functions as per incubator-kie-issues#1344
…1742 # Conflicts: # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/FEELDialect.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/impl/FEELBuilder.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/BaseFEELFunction.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/DateFunction.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/MatchesFunction.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/RangeFunction.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/TimeFunction.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/extended/DateFunction.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/extended/DurationFunction.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/extended/TimeFunction.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/impl/RangeImpl.java # kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/BooleanEvalHelper.java # kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/impl/RangeImplTest.java
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/FEELBooleanFunction.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/FEELCollectionFunction.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/FEELDurationFunction.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/FEELNumberFunction.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/FEELStringFunction.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.
Thank you for the PR @gitgabrio , especially for massive test coverage. I put some comments inline, some of them just for my better understanding.
Formatting
One general observation is about formatting changes, that I ma not sure are expected as part of this PR:
- on some places we add `
tag into Apache license header, while some licenses do not contain it
- on some places we split long string into concatenation, however not sure why it seems in codebase we have lines that are longer than places I have in mind, so not sure, is there some line length limit for the drools repository?
FEELDialect.java
Do I understand correctly that B-FEEL is always represented by single value "https://www.omg.org/spec/DMN/20240513/B-FEEL/" while FEEL can be represented by multiple values, depending on the DMN version? My guess would be also for B-FEEL may appear more values/version in future? If that is true maybe the FEELDialect
could be somehow refactored? Not saying this is somehow blocking from merge, just wanted to hear your opinion.
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/IsFunction.java
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/ListContainsFunction.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/B-FEEL/BFeelChecks.dmn
Outdated
Show resolved
Hide resolved
@jomarko About BFEEL multiple definitions, I also share some doubts, TBH.
So, my interpretation is that, regardless of the FEEL expression language used, whenever the "standard" version would return |
… BooleanEvalHelper
Implementing overall BFEELValueFunctionTest
...mn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/functions/BFEELValueFunctionTest.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.
Thank you for the PR @gitgabrio. I have one more question about the package org.kie.dmn.feel.runtime.functions
tests. There we basically have tests for evaluation of expressions for each DMN built in function - using FEEL dialect. We do not use B-FEEL dialect there is that correct? And we are safe to keep it as it, because B-FEEL affect evaluation only for small amount of cases? For example when function is invoked with some invalid argument, then returned default value is different in FEEL vs B-FEEL and these default values we test in BFEELValueFunctionTest
? Is my understanding correct?
kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNInputRuntimeBFEELTest.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/ast/InNode.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/BooleanEvalHelper.java
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.
Thank you for updates
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/BooleanEvalHelper.java
Outdated
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/BooleanEvalHelper.java
Show resolved
Hide resolved
kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/B-FEEL/BFeelChecks.dmn
Show resolved
Hide resolved
...ie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/B-FEEL/BFeelOverrideChecks.dmn
Show resolved
Hide resolved
...dmn-test-resources/src/test/resources/valid_models/DMNv1_5/B-FEEL/ConstraintsChecksBFeel.dmn
Show resolved
Hide resolved
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/DateFunction.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.
Thank you @gitgabrio, please consider my comments:
Fixes apache/incubator-kie-issues#1742
The B-FEEL proposal simply define a list of "default" values to return when the standard FEEL would return
null
This PR:
FEELDialect
enum to define different feel dialects, for the moment being the "standard" one and the B-FEEL oneObject defaultValue()
andList emendedList(List toEmend)
insideFEELFunction
, to be override on specifc needs by concrete implementationThe PR touched lot of files due to the pervasiveness of the logic, but the design itself seems clear, at least to me.
@AthiraHari77 @bncriju
How to replicate CI configuration locally?
Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.
build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.
How to retest this PR or trigger a specific build:
for pull request and downstream checks
for a full downstream build
run_fdb
for Jenkins PR check only
Build Now
button.