You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "AthiraHari77 (via GitHub)" <gi...@apache.org> on 2025/07/28 07:46:41 UTC
[PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
AthiraHari77 opened a new pull request, #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406
Closes https://github.com/apache/incubator-kie-issues/issues/2018
<details>
<summary>
How to replicate CI configuration locally?
</summary>
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](https://github.com/kiegroup/github-action-build-chain) to handle cross repository builds and be sure that we always use latest version of the code for each repository.
[build-chain tool](https://github.com/kiegroup/github-action-build-chain) 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](https://github.com/kiegroup/github-action-build-chain#local-execution) details to get more information about it.
</details>
<details>
<summary>
How to retest this PR or trigger a specific build:
</summary>
- for <b>pull request and downstream checks</b>
- Push a new commit to the PR. An empty commit would be enough.
- for a <b>full downstream build</b>
- for <b>github actions</b> job: add the label `run_fdb`
- for <b>Jenkins PR check only</b>
- If you are an ASF committer for KIE podling, login to Jenkins (https://ci-builds.apache.org/job/KIE/job/drools/), go to the specific PR job, and click on `Build Now` button.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio commented on code in PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#discussion_r2235453241
##########
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/impl/DMNRuntimeImpl.java:
##########
@@ -248,10 +250,34 @@ private DMNResultImpl createResult(DMNModel model, DMNContext context) {
private DMNResultImpl createResultImpl(DMNModel model, DMNContext context) {
DMNResultImpl result = dmnResultFactory.newDMNResultImpl(model);
+ Map<String, Object> baseInputs = new HashMap<>(context.getAll());
+ populateContextUsingAliases((DMNModelImpl) model, context.getAll(), baseInputs);
result.setContext(context.clone()); // DMNContextFPAImpl.clone() creates DMNContextImpl
return result;
}
+ @SuppressWarnings("unchecked")
+ private void populateContextUsingAliases(DMNModelImpl model, Map<String, Object> context, Map<String, Object> baseInputs) {
Review Comment:
Hi @AthiraHari77 thanks for the PR.
I have the impression there are some issues with this method, though:
1. the method is private, so it is not unit tested - while it should
2. it is very complex - line 264 is a method by itself (masked by stream usage) that should be tested in isolation
3. it is not very clear why that `importChainAliases` should contains only elements where chain.size > 1 (of course there is a reason, but it would be better to write a comment to explain it)
4. I think it would be better to avoid/reduce side-effect - i.e. this method should return a map that would be added to the original context in the calling method
5. last, this -> `Map<String, Object> current = context;` and following usage of `current` makes the code harder to read without clear reason
(Side-note: the failing tests are exactly related to the missing unit tests, that would have immediately shown the problem in the code))
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#issuecomment-3150074879
**PR job** `#8` was: **UNSTABLE**
Possible explanation: This should be test failures
<details>
<summary><b>Reproducer</b></summary>
build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u https://github.com/apache/incubator-kie-drools/pull/6406 --skipParallelCheckout
NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
</details>
Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/display/redirect
**Test results:**
- PASSED: 23776
- FAILED: 11
Those are the test failures:
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.core/DMNInputRuntimeTest/nonexistantInputNodeName(boolean)[1]/">org.kie.dmn.core.DMNInputRuntimeTest.nonexistantInputNodeName(boolean)[1]</a></summary>
<br/>Expected size: 1 but was: 2 in:<br/>[Message [id=0, level=ERROR, path=0001-input-data-string.dmn, line=34, column=-1<br/> text=DMN: FEEL ERROR while evaluating literal expression '"Hello " + Full Name': Unknown variable name 'Full Name' (FEEL expression evaluation error) ],<br/> Message [id=0, level=ERROR, path=0001-input-data-string.dmn, line=29, column=-1<br/> text=DMN: Error evaluating Decision node 'Greeting Message': DMNType{ https://www.omg.org/spec/DMN/20240513/FEEL/ : string } (DMN id: d_GreetingMessage, Error evaluating node) ]]
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.core/DMNRuntimeTest/emptyDecision1(boolean)[1]/">org.kie.dmn.core.DMNRuntimeTest.emptyDecision1(boolean)[1]</a></summary>
<br/>Expecting value to be true but was false
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.core/DMNRuntimeTest/count_csatrade_ratings(boolean)[1]/">org.kie.dmn.core.DMNRuntimeTest.count_csatrade_ratings(boolean)[1]</a></summary>
<br/>Expecting value to be true but was false
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.core/DMNRuntimeTest/npe(boolean)[1]/">org.kie.dmn.core.DMNRuntimeTest.npe(boolean)[1]</a></summary>
<br/>Expecting value to be true but was false
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.core/DMNRuntimeTest/kieIssue270(boolean)[1]/">org.kie.dmn.core.DMNRuntimeTest.kieIssue270(boolean)[1]</a></summary>
<br/>Expected size: 2 but was: 4 in:<br/>[Message [id=0, level=ERROR, path=habitability.dmn, line=31, column=-1<br/> text=DMN: Unknown variable name 'temperature' (DMN id: _0699341C-A1BE-4B6D-B8D5-3972D67FCA45, FEEL expression evaluation error) ],<br/> Message [id=0, level=ERROR, path=habitability.dmn, line=31, column=-1<br/> text=DMN: Unknown variable name 'oxygene' (DMN id: _0699341C-A1BE-4B6D-B8D5-3972D67FCA45, FEEL expression evaluation error) ],<br/> Message [id=0, level=WARNING, path=habitability.dmn, line=31, column=-1<br/> text=DMN: No rule matched for decision table 'habitability' and no default values were defined. Setting result to null. (DMN id: _0699341C-A1BE-4B6D-B8D5-3972D67FCA45, FEEL expression evaluation error) ],<br/> Message [id=0, level=ERROR, path=habitability.dmn, line=31, column=-1<br/> text=DMN: Error evaluating Decision node 'habitability': DMNType{ https://www.omg.org/spec/DMN/20240513/FEEL/ : string } (DMN id: _0699341C-A1BE-4B6D-B8D5-3
972D67FCA45, Error evaluating node) ]]
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.core.imports/DMNInputDataTransitiveImportTest/testTransitiveImportWithInputData/">org.kie.dmn.core.imports.DMNInputDataTransitiveImportTest.testTransitiveImportWithInputData</a></summary>
<br/>Expecting value to be false but was true
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.core.imports/DMNInputDataTransitiveImportTest/testTransitiveImport/">org.kie.dmn.core.imports.DMNInputDataTransitiveImportTest.testTransitiveImport</a></summary>
<br/>Expecting value to be false but was true
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.legacy.tests.core.v1_1/DMNInputRuntimeTest/nonexistantInputNodeName(VariantTestConf)[1]/">org.kie.dmn.legacy.tests.core.v1_1.DMNInputRuntimeTest.nonexistantInputNodeName(VariantTestConf)[1]</a></summary>
<br/>Expected size: 1 but was: 2 in:<br/>[Message [id=0, level=ERROR, path=0001-input-data-string.dmn, line=31, column=-1<br/> text=DMN: FEEL ERROR while evaluating literal expression '"Hello " + Full Name': Unknown variable name 'Full Name' (FEEL expression evaluation error) ],<br/> Message [id=0, level=ERROR, path=0001-input-data-string.dmn, line=26, column=-1<br/> text=DMN: Error evaluating Decision node 'Greeting Message': DMNType{ http://www.omg.org/spec/FEEL/20140401 : string } (DMN id: d_GreetingMessage, Error evaluating node) ]]
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.legacy.tests.core.v1_1/DMNRuntimeTest/emptyDecision1(VariantTestConf)[1]/">org.kie.dmn.legacy.tests.core.v1_1.DMNRuntimeTest.emptyDecision1(VariantTestConf)[1]</a></summary>
<br/>Expecting value to be true but was false
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.legacy.tests.core.v1_1/DMNRuntimeTest/count_csatrade_ratings(VariantTestConf)[1]/">org.kie.dmn.legacy.tests.core.v1_1.DMNRuntimeTest.count_csatrade_ratings(VariantTestConf)[1]</a></summary>
<br/>Expecting value to be true but was false
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/8/testReport/org.kie.dmn.legacy.tests.core.v1_1/DMNRuntimeTest/npe(VariantTestConf)[1]/">org.kie.dmn.legacy.tests.core.v1_1.DMNRuntimeTest.npe(VariantTestConf)[1]</a></summary>
<br/>expected: true<br/> but was: false
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio merged PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#discussion_r2235150517
##########
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/impl/DMNRuntimeImpl.java:
##########
@@ -248,10 +250,34 @@ private DMNResultImpl createResult(DMNModel model, DMNContext context) {
private DMNResultImpl createResultImpl(DMNModel model, DMNContext context) {
DMNResultImpl result = dmnResultFactory.newDMNResultImpl(model);
+ Map<String, Object> baseInputs = new HashMap<>(context.getAll());
+ populateContextUsingAliases((DMNModelImpl) model, context.getAll(), baseInputs);
result.setContext(context.clone()); // DMNContextFPAImpl.clone() creates DMNContextImpl
return result;
}
+ @SuppressWarnings("unchecked")
Review Comment:
The @SuppressWarnings("unchecked") annotation indicates potential type safety issues. Consider using generic types or type-safe casting to avoid unchecked operations.
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#issuecomment-3126244313
@AthiraHari77 Please double check failing tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#discussion_r2265968076
##########
kie-dmn/kie-dmn-validation/src/main/java/org/kie/dmn/validation/dtanalysis/DMNDTAnalyser.java:
##########
@@ -315,7 +315,7 @@ private CompilerContext feelCtx(DMNModel model, DecisionTable dt) {
parentNode = (DMNBaseNode) model.getBusinessKnowledgeModelByName(bkm.getName());
}
if (parentNode != null) {
- parentNode.getDependencies().keySet().forEach(k -> feelCtx.addInputVariableType(k, BuiltInType.UNKNOWN));
+ parentNode.getDependencies().forEach((namespaceWithName, dependency) -> feelCtx.addInputVariableType(dependency.getName(), BuiltInType.UNKNOWN));
Review Comment:
The lambda parameter 'namespaceWithName' is not used in the lambda body. Consider replacing it with an underscore or removing it if only the dependency value is needed.
```suggestion
parentNode.getDependencies().forEach((_, dependency) -> feelCtx.addInputVariableType(dependency.getName(), BuiltInType.UNKNOWN));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#issuecomment-3126495511
**PR job** `#2` was: **UNSTABLE**
Possible explanation: This should be test failures
<details>
<summary><b>Reproducer</b></summary>
build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u https://github.com/apache/incubator-kie-drools/pull/6406 --skipParallelCheckout
NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
</details>
Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/2/display/redirect
**Test results:**
- PASSED: 23734
- FAILED: 7
Those are the test failures:
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/2/testReport/org.kie.dmn.core.decisionservices/DMNDecisionServicesTest/importingWithSameDSNameBoxedInvocation(boolean)[1]/">org.kie.dmn.core.decisionservices.DMNDecisionServicesTest.importingWithSameDSNameBoxedInvocation(boolean)[1]</a></summary>
Duplicate key Person name (attempted merging values John Doe and John Doe)
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/2/testReport/org.kie.dmn.core.decisionservices/DMNDecisionServicesTest/importingWithSameDSNameBKMBoxedInvocation(boolean)[1]/">org.kie.dmn.core.decisionservices.DMNDecisionServicesTest.importingWithSameDSNameBKMBoxedInvocation(boolean)[1]</a></summary>
Duplicate key Person name (attempted merging values John Doe and John Doe)
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/2/testReport/org.kie.dmn.core.decisionservices/DMNDecisionServicesTest/importingWithSameDSName(boolean)[1]/">org.kie.dmn.core.decisionservices.DMNDecisionServicesTest.importingWithSameDSName(boolean)[1]</a></summary>
Duplicate key Person name (attempted merging values John Doe and John Doe)
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/2/testReport/org.kie.dmn.core.v1_4/DMN14specificTest/dMNv14Ch11Example2(VariantTestConf)[1]/">org.kie.dmn.core.v1_4.DMN14specificTest.dMNv14Ch11Example2(VariantTestConf)[1]</a></summary>
Duplicate key Property (attempted merging values {Address={ZIP=93933, State=CA, Street=272 10th St., City=Marina, Unit=null}, Monthly Tax Payment=350, Monthly HOA Condo Fee=0, Monthly Insurance Payment=100, Purchase Price=340000} and {Address={ZIP=93933, State=CA, Street=272 10th St., City=Marina, Unit=null}, Monthly Tax Payment=350, Monthly HOA Condo Fee=0, Monthly Insurance Payment=100, Purchase Price=340000})
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/2/testReport/org.kie.dmn.core.v1_4/DMN14specificTest/dMNv14Ch11Example2(VariantTestConf)[2]/">org.kie.dmn.core.v1_4.DMN14specificTest.dMNv14Ch11Example2(VariantTestConf)[2]</a></summary>
Duplicate key Property (attempted merging values {Address={ZIP=93933, State=CA, Street=272 10th St., City=Marina, Unit=null}, Monthly Tax Payment=350, Monthly HOA Condo Fee=0, Monthly Insurance Payment=100, Purchase Price=340000} and {Address={ZIP=93933, State=CA, Street=272 10th St., City=Marina, Unit=null}, Monthly Tax Payment=350, Monthly HOA Condo Fee=0, Monthly Insurance Payment=100, Purchase Price=340000})
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/2/testReport/org.kie.dmn.validation/ValidatorTest/validateAllValidSharedModels/">org.kie.dmn.validation.ValidatorTest.validateAllValidSharedModels</a></summary>
<br/>Expecting empty but was: [Message [id=0, level=ERROR, path=valid_models/DMNv1_6/0089-nested-inputdata-imports.dmn, line=0, column=0<br/> text=DMN: Failed XML validation of DMN file: Invalid FEEL {https://www.omg.org/spec/DMN/20230324/FEEL/} for version v1_6 (expected https://www.omg.org/spec/DMN/20240513/FEEL/) - at valid_models/DMNv1_6/0089-nested-inputdata-imports.dmn (DMN model failed XML schema validation) ],<br/> Message [id=0, level=ERROR, path=valid_models/DMNv1_6/Model_B.dmn, line=0, column=0<br/> text=DMN: Failed XML validation of DMN file: Invalid FEEL {https://www.omg.org/spec/DMN/20230324/FEEL/} for version v1_6 (expected https://www.omg.org/spec/DMN/20240513/FEEL/) - at valid_models/DMNv1_6/Model_B.dmn (DMN model failed XML schema validation) ],<br/> Message [id=0, level=ERROR, path=valid_models/DMNv1_6/Model_B2.dmn, line=0, column=0<br/> text=DMN: Failed XML validation of DMN file: Invalid FEEL {https://www.omg.org/spec/DMN/20230324/FEEL/} for versio
n v1_6 (expected https://www.omg.org/spec/DMN/20240513/FEEL/) - at valid_models/DMNv1_6/Model_B2.dmn (DMN model failed XML schema validation) ],<br/> Message [id=0, level=ERROR, path=valid_models/DMNv1_6/Say_hello_1ID1D.dmn, line=0, column=0<br/> text=DMN: Failed XML validation of DMN file: Invalid FEEL {https://www.omg.org/spec/DMN/20230324/FEEL/} for version v1_6 (expected https://www.omg.org/spec/DMN/20240513/FEEL/) - at valid_models/DMNv1_6/Say_hello_1ID1D.dmn (DMN model failed XML schema validation) ],<br/> Message [id=0, level=ERROR, path=null, line=0, column=0<br/> text=DMN: One of the supplied DMN Models has failed validation; cannot proceed to validation of the remaining DMN Models. (DMN Validation stopped on failed validation for some DMN Model) ]]
</details>
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6406/2/testReport/org.kie.dmn.validation.v1_5/DMN15ValidationsTest/namedImportValidation/">org.kie.dmn.validation.v1_5.DMN15ValidationsTest.namedImportValidation</a></summary>
Duplicate key A Person (attempted merging values {name=Hugh, age=32} and {name=Hugh, age=32})
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#discussion_r2235146673
##########
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/impl/DMNRuntimeImpl.java:
##########
@@ -248,10 +250,35 @@ private DMNResultImpl createResult(DMNModel model, DMNContext context) {
private DMNResultImpl createResultImpl(DMNModel model, DMNContext context) {
DMNResultImpl result = dmnResultFactory.newDMNResultImpl(model);
+ Map<String, Object> baseInputs = new HashMap<>(context.getAll());
+ populateContextUsingAliases((DMNModelImpl) model, context.getAll(), baseInputs);
result.setContext(context.clone()); // DMNContextFPAImpl.clone() creates DMNContextImpl
+ System.out.println(context);
Review Comment:
@AthiraHari77 Please remove this `System.out.println`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio commented on code in PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#discussion_r2235453241
##########
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/impl/DMNRuntimeImpl.java:
##########
@@ -248,10 +250,34 @@ private DMNResultImpl createResult(DMNModel model, DMNContext context) {
private DMNResultImpl createResultImpl(DMNModel model, DMNContext context) {
DMNResultImpl result = dmnResultFactory.newDMNResultImpl(model);
+ Map<String, Object> baseInputs = new HashMap<>(context.getAll());
+ populateContextUsingAliases((DMNModelImpl) model, context.getAll(), baseInputs);
result.setContext(context.clone()); // DMNContextFPAImpl.clone() creates DMNContextImpl
return result;
}
+ @SuppressWarnings("unchecked")
+ private void populateContextUsingAliases(DMNModelImpl model, Map<String, Object> context, Map<String, Object> baseInputs) {
Review Comment:
Hi @AthiraHari77 thanks for the PR.
I have the impression there are some issues with this method, though:
1. the method is private, so it is not unit tested - while it should
2. it is very complex - line 264 is a method by itself (masked by stream usage) that should be tested in isolation
3. it is not very clear why that importChainAliases should contains only elementes where chain.size > 1 (of course there is a reason, but it would be better to write a comment to explain it)
4. I think it would be better to avoid/reduce side-effect - i.e. this method should return a map that would be added to the original context in the calling method
5. last, this -> `Map<String, Object> current = context;` and following usage of `current` makes the code harder to read without clear reason
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issue#2018] Decision Engine: Review InputData value assignment [incubator-kie-drools]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #6406:
URL: https://github.com/apache/incubator-kie-drools/pull/6406#discussion_r2275892076
##########
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/ast/DMNBaseNode.java:
##########
@@ -111,8 +111,8 @@ public void setDependencies(Map<String, DMNNode> dependencies) {
this.dependencies = dependencies;
}
- public void addDependency(String name, DMNNode dependency) {
- this.dependencies.put(name, dependency);
+ public void addDependency(String nameWithModelNamespace, DMNNode dependency) {
+ this.dependencies.put(nameWithModelNamespace, dependency);
Review Comment:
@AthiraHari77 @gitgabrio Do you think it can be useful to add a comment above the `dependency` declaration explaining that the key is in `namespace + "."+ name` format?
##########
kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/ast/DMNBaseNode.java:
##########
@@ -111,8 +111,8 @@ public void setDependencies(Map<String, DMNNode> dependencies) {
this.dependencies = dependencies;
}
- public void addDependency(String name, DMNNode dependency) {
- this.dependencies.put(name, dependency);
+ public void addDependency(String nameWithModelNamespace, DMNNode dependency) {
+ this.dependencies.put(nameWithModelNamespace, dependency);
Review Comment:
@AthiraHari77 @gitgabrio Do you think it can be useful to add a comment above the `dependency` declaration explaining that the key is in `namespace + "."+ name` format?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org