<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">That worked.&nbsp; Thank you very much.<br><br>--- On <b>Tue, 8/2/11, Wolfgang Laun <i>&lt;wolfgang.laun@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Wolfgang Laun &lt;wolfgang.laun@gmail.com&gt;<br>Subject: Re: [rules-users] How to remove Drools 5 facts from a web service<br>To: "Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br>Date: Tuesday, August 2, 2011, 1:35 AM<br><br><div id="yiv1557807728">2011/8/1 Matthew Erler <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:wires8@yahoo.com" target="_blank" href="/mc/compose?to=wires8@yahoo.com">wires8@yahoo.com</a>&gt;</span><br><div class="yiv1557807728gmail_quote"><blockquote class="yiv1557807728gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:inherit;line-height:inherit;font-size-adjust:inherit;font-stretch:inherit;" valign="top">
The first thing that the service method needs to do is clear out all the facts inserted during the last service method invocation.&nbsp; I use StatefulKnowledgeSession.insert(Object fact) to add facts and StatefulKnowledgeSession.getAgenda().clear() to clear out all facts.&nbsp;</td>
</tr></tbody></table></blockquote><br>The Agenda is where all <i>rule activations</i> 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. <br>
<br>Calling kSession.dispose() and kBase.newStatefuleKnowledgeSession() is a perfectly reasonable way to clear the ring for the next round. <br><br>-W<br></div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></div></blockquote></td></tr></table>