[rules-users] confused on when to call fireAllRules

Wolfgang Laun wolfgang.laun at gmail.com
Mon Jan 25 14:09:33 EST 2010


There are two essentially different design patterns for using a production
rule system.

Both begin with session creation and the insertion of zero or more
facts meant to stay (more or less) til the end.

The first one is using a cycle (of one or more repeats) of the sequence
 - insert some more (I call them: "trigger") facts
 - call fireAllRules() to let the engine process what is there, in a ripple
   through ensuing rule firings, inserts, retracts and modifications, until
   everything turns quiet; then this call returns.

The second one calls fireUntilHalt(), in a thread of its own, while other
threads react, over time, to external data sources, to insert other facts,
with the engine reacting all the time. WorkingMemory.halt() must be
called to let this second call return.

No rules fire unless one of these two calls is active.

-W


On Mon, Jan 25, 2010 at 7:03 PM, ben780 <ben.craig2 at gmail.com> wrote:

>
> Hi,
>
> I'm also confused as well on the same topic as well.  I when I do an insert
> or update from rules, the rules are re-evaluated.
>
> When i do an insert or update from java code it does not re-evaluate the
> rules.  However, when I call fireAllRules it does fire the rules as
> expected
> based on the inserted/updated objects.
>
> Regards,
>
> Ben
> --
> View this message in context:
> http://n3.nabble.com/confused-on-when-to-call-fireAllRules-tp92648p138288.html
> Sent from the Drools - User 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/20100125/7ae0bfce/attachment.html 


More information about the rules-users mailing list