If you use a StatelessKnowledgeSession you won&#39;t need to remove the old facts.<br><br>If however you want to use a StatefulKnowledgeSession for other reasons the insert method returns a FactHandle that can be later used to retrieve the fact: ksession.retract(factHandle). Please refer to the documenation for more details.<br>
<br><div class="gmail_quote">On 20 October 2010 16:35, nkumar <span dir="ltr">&lt;<a href="mailto:nkumar@objectwave.com">nkumar@objectwave.com</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;">
<br>
Hi..<br>
<br>
<br>
I want to delete the objects which i inserted earlier to execute the rules<br>
upon. Why i want this is i have two lists containing 20 objects of two<br>
different classes. for every combination i am assigning some values to the<br>
class variables in the rule file. So at any single time i want to execute<br>
rule on a single set of 2 classes.<br>
<br>
ksession.insert(object1 of class1)<br>
ksession.insert(object1 of class2)<br>
<br>
<br>
then next time i want this on<br>
<br>
<br>
ksession.insert(object1 of class1)<br>
ksession.insert(object2 of class2)<br>
<br>
and so on..<br>
<br>
I can insert all the objects once and can execute the rules on the objects<br>
but i have to save result of each combination in the list. No matter what<br>
the output is.<br>
<br>
Please suggest how can i solve this. if i have to insert only 2 objects at a<br>
time then after inserting an object,there is no use to insert that again. So<br>
how can i remove the objects from the memory after executing the rules.<br>
<br>
<br>
Thansk...appreciate your help.<br>
<font color="#888888">--<br>
View this message in context: <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>

Sent from the Drools - User mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>