You’d probably be better to use a batch command though containing the three commands rather than calling the methods on the ksession directly – it makes for slightly cleaner and more reliable integration from my experience.

 

Thomas

From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 08 July 2011 13:35
To: Rules Users List
Subject: Re: [rules-users] FireAllRules and threads

 

 

On 8 July 2011 13:46, echirulli <echirulli@gmail.com> wrote:

Hi there,
I've got a question regarding statefull session and threads.
I searched a lot about this topic but I'm still a bit confused so...
When a StatefullSession - fireAllRules() returns, can I be sure that the
entire rules processing has ended?
I red something about the fact that this is true unless rules inference
happens, is it correct?


No. A fireAllRules() returns after all of "inference" has happened and no
more activations are eligible for firing.
 

My simple purpose is to insert a fact into a statefullsession working
memory, fire rules, wait until the end of rules processing and than retract
that fact.
How can i do it?


FactHandle fh = kSession.insert( object );
kSession.fireAllRules();
kSession.retract( fh);

-W
 

Thank you
Errico



--
View this message in context: http://drools.46999.n3.nabble.com/FireAllRules-and-threads-tp3151572p3151572.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

 




**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************