geertvb opened a new issue, #6339: URL: https://github.com/apache/incubator-kie-drools/issues/6339
A rule that was fired as a result of a fact update, fires again after restoring the session and calling fireAllRules. I created a project in github that reproduces the behavior. See https://github.com/geertvb/drools-restore-session-issue The project is a simple maven spring boot drools project that executes 4 steps. Step 1 creates a session, inserts a person as a fact and fires all rules. Step 2 restores the session, inserts an integer and fires all rules. The inserted integer fires rules that updates the person age. Step 3 restores the session and fires all rules. As nothing got inserted, no rules should fire but it does fire a rule. Step 4 restores the session again ad fire all rules. This time, no rules are fired. The application executes fireAllRules right after restoring the session in every step to check if unnecessary rules get fired. For step 3 that is the case. See the error statement _ERROR e.europa.ec.cc.drools.SessionFactory No rules should have been fired after init, but 1 rule(s) did fire_ in the output of the application below The application also executes fireAllRules before ending a step and executing the next step to be sure no further rules trigger. Step 2 clearly indicates that "Fired 0 rule(s) before closing" ``` 15:15:02.197 INFO eu.europa.ec.cc.drools.App ----- step1 - Insert person ----- 15:15:02.216 INFO e.europa.ec.cc.drools.SessionFactory Session id: 0, fact count: 0 15:15:02.216 INFO eu.europa.ec.cc.drools.App Inserting Person(id=666, name=John Doe, age=32) 15:15:02.220 INFO eu.europa.ec.cc.drools.App Person handle: [fact 0:1:718130408:-1363838918:1:DEFAULT:NON_TRAIT:eu.europa.ec.cc.drools.Person:Person(id=666, name=John Doe, age=32)] 15:15:02.233 INFO eu.europa.ec.cc.rules Person: Person(id=666, name=John Doe, age=32) 15:15:02.233 INFO eu.europa.ec.cc.drools.App Fired 1 rule(s) after insert Person(id=666, name=John Doe, age=32) 15:15:02.233 INFO eu.europa.ec.cc.drools.App Fired 0 rule(s) before closing 15:15:02.239 INFO o.d.r.h.H2MVStoreStorageManager Using H2MVStoreStorageManager 15:15:02.240 INFO eu.europa.ec.cc.drools.App ----- step2 - Update age ----- 15:15:02.243 INFO e.europa.ec.cc.drools.SessionFactory Session id: 1, fact count: 1 15:15:02.243 INFO eu.europa.ec.cc.drools.App Inserting 32 15:15:02.244 INFO eu.europa.ec.cc.drools.App Integer handle: [fact 0:2:1589745212:32:2:DEFAULT:NON_TRAIT:java.lang.Integer:32] 15:15:02.245 INFO eu.europa.ec.cc.rules Age: 32 15:15:02.247 INFO eu.europa.ec.cc.rules Person: Person(id=666, name=John Doe, age=33) 15:15:02.247 INFO eu.europa.ec.cc.drools.App Fired 2 rule(s) after insert 32 15:15:02.247 INFO eu.europa.ec.cc.drools.App Fired 0 rule(s) before closing 15:15:02.251 INFO o.d.r.h.H2MVStoreStorageManager Using H2MVStoreStorageManager 15:15:02.252 INFO eu.europa.ec.cc.drools.App ----- step3 - Just load Session ----- 15:15:02.253 INFO e.europa.ec.cc.drools.SessionFactory Session id: 2, fact count: 1 15:15:02.254 INFO eu.europa.ec.cc.rules Person: Person(id=666, name=John Doe, age=33) 15:15:02.254 ERROR e.europa.ec.cc.drools.SessionFactory No rules should have been fired after init, but 1 rule(s) did fire 15:15:02.254 INFO eu.europa.ec.cc.drools.App Fired 0 rule(s) before closing 15:15:02.257 INFO o.d.r.h.H2MVStoreStorageManager Using H2MVStoreStorageManager 15:15:02.259 INFO eu.europa.ec.cc.drools.App ----- step4 - Just load Session ----- 15:15:02.260 INFO e.europa.ec.cc.drools.SessionFactory Session id: 3, fact count: 1 15:15:02.260 INFO eu.europa.ec.cc.drools.App Fired 0 rule(s) before closing ``` -- 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]
