Skip to content
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

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

samuel-beniamin
Copy link
Contributor

@samuel-beniamin samuel-beniamin commented Sep 11, 2024

@pibizza
Copy link
Contributor

pibizza commented Sep 12, 2024

Added @gitgabrio, he is working on this stuff at the moment.

.map(DMNNode::getName)
.collect(Collectors.toList());

assertThat(decisionNames).containsOnly("sumUp", "iterating", "determineModifier", "concatNames");
Copy link
Contributor

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.

Suggested change
assertThat(decisionNames).containsOnly("sumUp", "iterating", "determineModifier", "concatNames");
assertThat(dmnRuntime.getModels()).flatExtracting(dmnModel -> dmnModel.getDecisions()).extracting(DMNNode::getName).containsOnly("sumUp", "iterating", "determineModifier", "concatNames");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, applied ✅

@gitgabrio
Copy link
Contributor

Hi @samuel-beniamin
Reading the original ticket, it seems there is some sort of issue in the implementation.
But IINW, this PR does not change the implementation at all (if just add a log), and rather modifies a test: could you clarify that ?

@samuel-beniamin
Copy link
Contributor Author

Hi @samuel-beniamin Reading the original ticket, it seems there is some sort of issue in the implementation. But IINW, this PR does not change the implementation at all (if just add a log), and rather modifies a test: could you clarify that ?

Hello @gitgabrio, It is in the implementation, I can still see my change returning or exiting early incase the model is not the same.

Screenshot 2024-09-12 at 15 53 20

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;
}

@samuel-beniamin
Copy link
Contributor Author

@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?

@gitgabrio
Copy link
Contributor

@samuel-beniamin first of all, thanks for the PR ❤️
And then, thanks for explanation - my bad, I was confused by the log.
I see your point, and this PR is fine for me.
But TBH, we did not touch this module for some time, so we would need to dig in it a bit; and as you wrote

but maybe the proper fix should be in the DMNCompilerImpl.

this seems more a workaround for a symptom of a problem somewhere else.
So, if you may, I would kindly ask you to create another ticket (or duplicate the original one) so that we could focus on the root problem, eventually with your help : wdyt ?

Copy link
Contributor

@pibizza pibizza left a 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.

@samuel-beniamin
Copy link
Contributor Author

samuel-beniamin commented Sep 13, 2024

@gitgabrio Thank you for approving the the PR.

this seems more a workaround for a symptom of a problem somewhere else.

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.

@samuel-beniamin
Copy link
Contributor Author

Here is a ticket to address a proper fix in the future apache/incubator-kie-issues#1478

@gitgabrio gitgabrio merged commit 470b9f0 into apache:main Sep 13, 2024
10 checks passed
@gitgabrio
Copy link
Contributor

Great @samuel-beniamin , many thanks!!!

rgdoliveira pushed a commit to rgdoliveira/drools that referenced this pull request Oct 3, 2024
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
rodrigonull pushed a commit to rodrigonull/incubator-kie-drools that referenced this pull request Oct 7, 2024
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
@samuel-beniamin
Copy link
Contributor Author

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?

@gitgabrio
Copy link
Contributor

Hi @samuel-beniamin
this PR has been merged, and IINW it should already be in 10.0 release: am I missing something ?

@samuel-beniamin
Copy link
Contributor Author

Hi @samuel-beniamin this PR has been merged, and IINW it should already be in 10.0 release: am I missing something ?

I tried to check both on

  1. The released JAR file in maven for version 10.0.0 https://mvnrepository.com/artifact/org.kie/kie-dmn-signavio/10.0.0 and it didn't include the fix.
  2. The branch 10.0.x it didn't include this fix or commit.

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?
If I am wrong, could you please point me to the public release of the JAR file?

@gitgabrio
Copy link
Contributor

Sorry @samuel-beniamin
the 10 release has been slightly cumbersome due to the big changes we had in the meantime, so probably I'm confusing date.
@baldimir @yesamer, could you please help here ?

@yesamer
Copy link
Contributor

yesamer commented Jan 10, 2025

@samuel-beniamin @gitgabrio
IINW, we branched 10 version before @samuel-beniamin PR, as you may notice here --> https://github.com/apache/incubator-kie-drools/commits/10.0.x/
It seems that we created the 10 branch on Jul 16, 2024, and @samuel-beniamin's PR was not backported in that branch, as was merged on Sep 13, 2024.
I'm afraid you need to wait for the next release to have your changes released.
I guess you will not be happy about that @samuel-beniamin, I apologize for that, but as @gitgabrio said 10 release was a nightmare

@baldimir
Copy link
Contributor

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.

@samuel-beniamin
Copy link
Contributor Author

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.
Thank you all again 🙇

@yesamer
Copy link
Contributor

yesamer commented Jan 20, 2025

Hi @samuel-beniamin, we started the discussion about the release of 10.1.0 in the previous week (that will contain your fix)
Despite a released date is still not defined, I would be surprised if 10.1.0 will land after 2025 Q1 . Please stay tuned in the next weeks :)

@gitgabrio
Copy link
Contributor

gitgabrio commented Jan 20, 2025

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE thrown when loading multiple DMN XML files including a Signavio's multi instance decision
5 participants