You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "aner-perez (via GitHub)" <gi...@apache.org> on 2025/10/30 19:04:22 UTC
[I] Activation Groups are only applied for initial rule activation [incubator-kie-drools]
aner-perez opened a new issue, #6509:
URL: https://github.com/apache/incubator-kie-drools/issues/6509
When multiple rules belonging to the same activation group are activated repeatedly by fact changes, only the first activation fires the cancellation of other activations in the activation-group. Subsequent activations result in the firing of ALL activated rules in the activation group. None are cancelled.
A simple ruleset that demonstrates this behavior is as follows.
```
package com.example
import StringFact;
rule "First rule in first activation group"
activation-group "first-group"
salience 10
when
$strf : StringFact(value == "force", count < 5)
then
end
rule "Second rule in first activation group"
activation-group "first-group"
salience 5
when
$strf : StringFact(value == "force", count < 5)
then
modify($strf) { setValue("fail") }
end
rule "Rule without activation group"
salience 2
when
$strf : StringFact(value == "force", count < 1)
then
modify($strf) { incrementCount() }
end
```
The second rule should never fire as long as the first rule has also been activated.
This test fails in the 7.x branch as well as the main branch.
I tracked down the issue to differences in PhreakRuleTerminalNode.doLeftTupleInsert(...) vs PhreakRuleTerminalNode.doLeftTupleUpdate(...). The insert method calls activationsManager.addItemToActivationGroup( leftTuple ) but the update method does not. Adding this call to the update methods allows the test to succeed.
See attached test class for the Drools::Model::Codegen module and PhreakRuleTerminalNode.java with suggested fix. This is my first time looking at this code base so "fix" needs to be evaluated for correctness.
[ActivationGroupReactivateTest.java](https://github.com/user-attachments/files/23243570/ActivationGroupReactivateTest.java)
[PhreakRuleTerminalNode.java](https://github.com/user-attachments/files/23243581/PhreakRuleTerminalNode.java)
--
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.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: [I] Activation Groups are only applied for initial rule activation [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas closed issue #6509: Activation Groups are only applied for initial rule activation
URL: https://github.com/apache/incubator-kie-drools/issues/6509
--
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