Search code examples
drools

Drools - Revert rule engine to initial state?


Is there a way to revert rule engine ( stateful ) to initial state ( state where all rules and facts are inserted and fireAllRules() not been fired ) ?

Thanks in advance !


Solution

  • There is no initial state in a session besides when it's created. When you insert Facts into the session the rules are evaluated, so you cannot go back into the evaluation steps. Maybe you can refactor your use case to make it perform better, but without more knowledge about your specific situation is very difficult to help you.