Sure, check out KnowledgeBase&#39;s removeRule(String, String) method. Modifications to you KnowledgeBase are going to be more expensive than with Sessions, so ask yourself whether manipulating KnowledgeBase&#39;s at runtime is something you really want to be doing when you (probably) will be able to get identical function by re-thinking your approach. <br>
<br><div class="gmail_quote">On 22 October 2010 17:37,  <span dir="ltr">&lt;<a href="mailto:rouvas@di.uoa.gr">rouvas@di.uoa.gr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">Michael Anstis wrote:<br>
&gt; If you use a StatelessKnowledgeSession you won&#39;t need to remove the old<br>
&gt; facts.<br>
&gt;<br>
&gt; If however you want to use a StatefulKnowledgeSession for other reasons<br>
&gt; the<br>
&gt; insert method returns a FactHandle that can be later used to retrieve the<br>
&gt; fact: ksession.retract(factHandle). Please refer to the documenation for<br>
&gt; more details.<br>
<br>
</div>That is very convenient, I&#39;ve also been looking (obviously not hard<br>
enough) for a similar facility.<br>
<br>
Is here something similar for &quot;retracting&quot; rules as well?<br>
<br>
-Stathis<br>
<div><div></div><div class="h5"><br>
&gt;<br>
&gt; On 20 October 2010 16:35, nkumar &lt;<a href="mailto:nkumar@objectwave.com">nkumar@objectwave.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi..<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I want to delete the objects which i inserted earlier to execute the<br>
&gt;&gt; rules<br>
&gt;&gt; upon. Why i want this is i have two lists containing 20 objects of two<br>
&gt;&gt; different classes. for every combination i am assigning some values to<br>
&gt;&gt; the<br>
&gt;&gt; class variables in the rule file. So at any single time i want to<br>
&gt;&gt; execute<br>
&gt;&gt; rule on a single set of 2 classes.<br>
&gt;&gt;<br>
&gt;&gt; ksession.insert(object1 of class1)<br>
&gt;&gt; ksession.insert(object1 of class2)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; then next time i want this on<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ksession.insert(object1 of class1)<br>
&gt;&gt; ksession.insert(object2 of class2)<br>
&gt;&gt;<br>
&gt;&gt; and so on..<br>
&gt;&gt;<br>
&gt;&gt; I can insert all the objects once and can execute the rules on the<br>
&gt;&gt; objects<br>
&gt;&gt; but i have to save result of each combination in the list. No matter<br>
&gt;&gt; what<br>
&gt;&gt; the output is.<br>
&gt;&gt;<br>
&gt;&gt; Please suggest how can i solve this. if i have to insert only 2 objects<br>
&gt;&gt; at<br>
&gt;&gt; a<br>
&gt;&gt; time then after inserting an object,there is no use to insert that<br>
&gt;&gt; again.<br>
&gt;&gt; So<br>
&gt;&gt; how can i remove the objects from the memory after executing the rules.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thansk...appreciate your help.<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://drools-java-rules-engine.46999.n3.nabble.com/How-can-i-delete-any-object-after-executing-the-rules-from-the-memory-tp1739477p1739477.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/How-can-i-delete-any-object-after-executing-the-rules-from-the-memory-tp1739477p1739477.html</a><br>

&gt;&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto: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></div></blockquote></div><br>