As I see it you have a number of options,
As you have said you could scope your latches so that they only apply to a particular
object, rather than generating a UUID you can probably get away with using the object
reference itself; however you will also need to watch out for memory leaks, this can
probably be solved by having a rule which removes latches when the object they refer to is
no longer in the knowledge base.
You may also be able to use drools flow to fire the pieces in one at a time but not need
to recreate the entire state again.
Your best bet (if possible) is to restructure your model so that your actions don't
modify the objects that your conditions are based upon. For instance rather than actually
performing any changes you populate result objects and use a query after the rules have
finished firing to retrieve them all. This does have the downside however that it removes
one of the advantages of a rules engine that the actions can cause other rules to activate
and deactivate.
Hope this helps, if not hopefully someone else will have some better insights than me,
Thomas
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-
bounces(a)lists.jboss.org] On Behalf Of djb
Sent: 26 January 2010 09:07
To: rules-users(a)lists.jboss.org
Subject: Re: [rules-users] infinite loop in decision table
Hi Thomas,
I implemented the latch system as you suggested, but came to a problem when
running batches of data.
Since the latch is set when the rule fires, you can't have that rule fire
for more than one piece of data.
So, with this method, for batch processing, you need to include a UUID into
each latch.
Are there any other patterns? All this UUID and Latch/Flag functionality
seems really a lot more complicated than it should be.
I suppose I can write it to only process one piece of data at a time, but
that might end up slower.
Regards,
Daniel
--
View this message in context:
http://n3.nabble.com/infinite-loop-in-decision-
table-tp129933p139034.html
Sent from the Drools - User mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)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(a)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.
An NDS Group Limited company.
www.nds.com