That worked.  Thank you very much.

--- On Tue, 8/2/11, Wolfgang Laun <[email protected]> wrote:

From: Wolfgang Laun <[email protected]>
Subject: Re: [rules-users] How to remove Drools 5 facts from a web service
To: "Rules Users List" <[email protected]>
Date: Tuesday, August 2, 2011, 1:35 AM

2011/8/1 Matthew Erler <[email protected]>


The first thing that the service method needs to do is clear out all the facts 
inserted during the last service method invocation.  I use 
StatefulKnowledgeSession.insert(Object fact) to add facts and 
StatefulKnowledgeSession.getAgenda().clear() to clear out all facts. 

The Agenda is where all rule activations live. Facts are reachable via the 
kSession object, e.g., kSession.getFactHandles(), and you could use retract() 
on them. But note well that retracting facts is not a free lunch: each one 
updates the Rete network. 


Calling kSession.dispose() and kBase.newStatefuleKnowledgeSession() is a 
perfectly reasonable way to clear the ring for the next round. 

-W


-----Inline Attachment Follows-----

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to