[rules-users] How to make the working memory "clean"?

Wolfgang Laun wolfgang.laun at gmail.com
Thu Mar 1 16:44:46 EST 2012


On 1 March 2012 16:21, shawn <youngxiao121 at hotmail.com> wrote:

> I don't understand the garbage collection mechanism in drool, though I have
> read the expert documentation.
>
There is no specific "garbage collection" by Drools - Java's GC does the
trick.



> 1 - how to retract a global variable in drool?
>
You don't "retract", you can set it to null, same way as set to an object.


> 2 - how to retract all the facts that have been inserted into the working
> memory?

Several ways, simple is to use KnowledgeSession's getFactHandles, and
retract them.

Or dispose the entire Session, and create another one, which might be
faster.


> If I use halt(), does it retract all facts in the working memory and
> stop the all the rules?
>
No. Yes.
-W

>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-make-the-working-memory-clean-tp3790730p3790730.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120301/8c91d779/attachment.html 


More information about the rules-users mailing list