dcmaf opened a new issue, #6421: URL: https://github.com/apache/incubator-kie-drools/issues/6421
The attached unit tests contain two variations of the same scenario, which involves two agenda groups. In the scenario, there is a rule A in agenda/ruleflow group XGroup that performs actions that result in two other rules, B and C, activating. Rule B is also in XGroup. Rule C is in YGroup and has auto-focus set to true. The expectation is that the activation of C will result in YGroup being pushed on the agenda stack and rule C firing. After rule C completes, the agenda stack will be popped, returning to XGroup, and rule B will fire. In one scenario (ruleCActivatesBeforeRuleBInsertTest), rule A updates an existing fact that activates rule B and inserts a new fact that activates rule C. The observed behavior is that rule B activates, YGroup is pushed on the agenda stack, rule C activates, rule B fires, and then rule C fires. Thus, rule B in group XGroup is firing when YGroup is on the top of the agenda stack and has a pending activation. In the other scenario (ruleCActivatesBeforeRuleBUpdateTest), rule A updates an existing fact that activates both rule B and rule C. The observed behavior is that rule B activates, rule C activates, and rule B fires. YGroup is never pushed on the agenda stack and rule C never fires. The first scenario (insert activates rule C) passes on 7.74.1 and fails on 8.43.0 and 10.1.0. The second scenario (update activates rule C) fails on all three versions. We have only observed the second scenario in this unit test case; our rule base has instances in which auto-focus rules are activated by fact updates and the agenda group is being pushed. Please let us know if our understanding of agenda/ruleflow groups and auto-focus is incorrect and this is the expected behavior for these scenarios. @mariofusco: The first scenario (insert activates rule C) issue appears to have been introduced by commit https://github.com/apache/incubator-kie-drools/commit/a264f338e8f70d4e6f57f681ef2259e52ce7c73a (DROOLS-7523), specifically the replacement of evaluateAndFire in AbstractRuleEvaluator with a method by the same name in AbstractGroupEvaluator. The attached patch appears to solve that issue; our understanding of the code is quite limited and there is likely a more elegant solution! Note: .txt suffix added to the unit test file because github rejected uploading a file with a .java suffix. [checkForGroupChange.patch](https://github.com/user-attachments/files/21782058/checkForGroupChange.patch) [FiringOrderTest.java.txt](https://github.com/user-attachments/files/21782098/FiringOrderTest.java.txt) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
