Hello,
we use a bpmn process to call groups by ruleFlowGroup eg agenda-group in drools 10.0, for rules previously used in 7.xx version, but our rules/process execution ends in NPE in 10.0.0
We encounter NullPointer exceptions that look like the ones in the bug reported in
https://groups.google.com/g/drools-usage/c/8uEneCrbaYY, so I tried some workarounds, but the NPE does not occur in a from / accumulate condition.
The other thing is that the startProcess seems to absorb this (Runtime) exception, so from the exception handling point of view, nothing happens.
The only hint I have is that a rule for which the agenda group has already been deactivated has a match created. See below for details :
My questions would be :
- does this bug ring a bell to drools developers in v10 ? I saw no issue/PR on this in
https://github.com/apache/incubator-kie-drools/issues?q=is%3Aissue%20null- is there a possible fix already in 10.1 rc1 ?
- how can I debug efficiently this ? I put loggers in AgendaEventListener implementation, but maybe missing something yet in the details of the events to analyse.
- could I use a simplified workflow in my bpmn and fire rules with more control like in
https://docs.jboss.org/drools/release/8.44.0.Final/drools-docs/drools/rule-engine/index.html#_agenda_groups_for_rules ?
eg
Agenda agenda = ksession.getAgenda();
agenda.getAgendaGroup( "report" ).setFocus();
agenda.getAgendaGroup( "calculation" ).setFocus();
ksession.fireAllRules();
- More info on our setup / not easy to create a reproducer
Eg order in our workflow simplified (we have 30 groups) is
rule group 1 : 10 rules
rule group 2
rule group 3
rule group 4
rule group 5
rule group 6 : 6 rules
- When Calling a fire All rules :
rule groups 1 to 5 execute in order : we see messages that activate and deactivate the groups with or without match Fired
afterRuleFlowGroupActivated : rule group 1
afterMatchFired (rule of group 1)
afterRuleFlowGroupDeactivated : rule group 1
... activation and deactivation of rule groups 2 to 5
afterRuleFlowGroupActivated rule group 6
afterMatchFired : rule in rule group 6
matchCreated : rule in rule group 1
-> Null pointer
Caused by: java.lang.NullPointerException: Cannot invoke "org.drools.core.util.DoubleLinkedEntry.setNext(org.drools.core.util.SingleLinkedEntry)" because the return value of "org.drools.core.util.DoubleLinkedEntry.getPrevious()" is null
at org.drools.core.util.LinkedList.remove(LinkedList.java:178)
at org.drools.core.phreak.RuleExecutor.removeDormantTuple(RuleExecutor.java:318)
at org.drools.core.phreak.RuleExecutor.modifyActiveTuple(RuleExecutor.java:338)
at org.drools.core.phreak.PhreakRuleTerminalNode.doLeftTupleUpdate(PhreakRuleTerminalNode.java:227)