How to remove a object from KnowledgeSession in Drools after fireAllRules - Java @ Desk

Friday, May 17, 2013

How to remove a object from KnowledgeSession in Drools after fireAllRules

Explanation :

Use retract method to remove the fact from the KnowledgeSession

Assume ksession is the StatefulKnowledgeSession object

List list = new ArrayList();
list.add("One");
list.add("Two");
list.add("Three");
ksession.insert(list);

ksession.fireAllRules();

ksession.retract(ksession.getFactHandle(list));







No comments:

Post a Comment