-
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!!! |
Closes apache/incubator-kie-issues#1474