droolsdrools-guvnordrools-plannerdrools-fusion

How to reset the StatefulKnowledgeSession?


I am using the StatefulKnowledgeSession for the firing the all my alert rules.

In the prepare part i am not getting the how to reset the session. Hence, it would create overriding of rules again?


Solution

  • You can reset the StatefulKnowledgeSession by calling the dispose() method present in the session.

    Like this: ksession.dispose();

    Usefull link:https://docs.jboss.org/jbpm/v5.1/javadocs/org/drools/runtime/StatefulKnowledgeSession.html