-
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#1474] Fix NPE when loading multiple Signavio MID #6080
[incubator-kie-issues#1474] Fix NPE when loading multiple Signavio MID #6080
Conversation
Added @gitgabrio, he is working on this stuff at the moment. |
.map(DMNNode::getName) | ||
.collect(Collectors.toList()); | ||
|
||
assertThat(decisionNames).containsOnly("sumUp", "iterating", "determineModifier", "concatNames"); |
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.
Maybe you can simply this and the previous statement using directly assertj assertions. Assertj has a powerful fluent interface to manipulate streams and perform stream operation. You can check extracting and flatExtracting, for example.
assertThat(decisionNames).containsOnly("sumUp", "iterating", "determineModifier", "concatNames"); | |
assertThat(dmnRuntime.getModels()).flatExtracting(dmnModel -> dmnModel.getDecisions()).extracting(DMNNode::getName).containsOnly("sumUp", "iterating", "determineModifier", "concatNames"); |
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.
Looks good, applied ✅
Hi @samuel-beniamin |
Hello @gitgabrio, It is in the implementation, I can still see my change returning or exiting early incase the model is not the same. So basically, the compiler calls this callback regardless of the model it is trying to evaluate, but in this case the extra check is basically the fix, it seems trivial but it is blocking if we need to load multiple models. if (cModel != model) {
return;
} |
@gitgabrio So skipping the execution of the callback in the specific case of Signavio's extension and in the case it is a MID executing callback for a different model, is what you are working on right now? |
@samuel-beniamin first of all, thanks for the PR ❤️
this seems more a workaround for a symptom of a problem somewhere else. |
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.
Looks good to me.
@gitgabrio Thank you for approving the the PR.
Yes, I agree too, I think a proper fix should be to validate for which model is the call back being executed, by the compiler itself. I will create another ticket for it. |
Here is a ticket to address a proper fix in the future apache/incubator-kie-issues#1478 |
Great @samuel-beniamin , many thanks!!! |
apache#6080) * [incubator-kie-issues#1474] Fix NPE when loading multiple Signavio MID * [incubator-kie-issues#1474] Add debugging logs for skipping MID callback * [incubator-kie-issues#1474] Use Assertj fluent interface
apache#6080) * [incubator-kie-issues#1474] Fix NPE when loading multiple Signavio MID * [incubator-kie-issues#1474] Add debugging logs for skipping MID callback * [incubator-kie-issues#1474] Use Assertj fluent interface
Hey @gitgabrio, I am wondering how can I move this fix to be included in the next planned release? And what is the next planned release? |
Hi @samuel-beniamin |
I tried to check both on
Assuming I am not wrong, what would be next release to include this commit? and what can I do or assist with from my side? |
Sorry @samuel-beniamin |
@samuel-beniamin @gitgabrio |
Hi, correct, what @yesamer wrote. @samuel-beniamin If you cannot wait for the next release, you could backport your fix locally to the 10.0.x branch and you could build a patched jar meanwhile. It should be just a matter of building with Maven (mvn clean install). If you need to use it with multiple people, you would need to upload it to your Maven repository or each person copy it to their m2 local repositories. |
Hello @baldimir, @yesamer and @gitgabrio First, thank you all for your answers. Unfortunately we have to wait in that case, as we are not the consumers of that library. Our customers are relying on it, and hence we can't just use the dependency as an m2 patch locally, but in fact wait for the next release. I am still wondering if the next release is planned for a date or even an estimated quarter? Any hint would be greatly appreciated. |
Hi @samuel-beniamin, we started the discussion about the release of 10.1.0 in the previous week (that will contain your fix) |
👍 |
Closes apache/incubator-kie-issues#1474