[rules-users] Avoiding loops

Leonardo Gomes leonardo.f.gomes at gmail.com
Thu Jul 15 08:37:12 EDT 2010


Thanks for the feedback, guys.

Leonardo.

On Wed, Jul 14, 2010 at 8:41 AM, Wolfgang Laun <wolfgang.laun at gmail.com>wrote:

> Another option would be the addition of a single "Trigger" fact, inserted
> along
> with your regular facts, added as an additional pattern to all rules,
> and retracted
> in each RHS.
>
> You might also consider using Event processing to terminate the Engine's
> run after the first AfterActivationFiredEvent.
>
> -W
>
>
> 2010/7/14 Mauricio Salatino <salaboy at gmail.com>:
> > you can also add an extra property to your facts to check and add
> condition
> > to check that property. (like a processed flag)
> > Greetings
> >
> >
> > 2010/7/13 Leonardo Gomes <leonardo.f.gomes at gmail.com>
> >>
> >> Hi Droolers,
> >>
> >> I'm trying to avoid loops and looking at different possibilities
> (no-loop,
> >> activation-group, lock-on-active, etc.).
> >>
> >> >Scenario I want to avoid:
> >>
> >> For example, the initial facts trigger *rule 1*, which inserts new facts
> >> that will trigger *rule 2*, which will then insert facts that would
> >> re-trigger *rule 1*.
> >>
> >> >Possibilities I tried:
> >>
> >> no-loop -> just prevents the re-activation of the same rule
> >> lock-on-active -> I can't know which rules should have lock-on-active
> set
> >> to true, since I don't know what will be the initial facts.
> >>
> >> >What I'm trying to achieve:
> >>
> >> All rules in my rule set should execute only once. So, a rule inserts
> new
> >> facts only rules that haven't executed so far, should be activated.
> >>
> >> Is there a way to do that, let's say 'out-of-the-box', with DRL?
> >>
> >> Thank you,
> >> Leo.
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> >
> >
> > --
> >  - CTO @ http://www.plugtree.com
> >  - MyJourney @ http://salaboy.wordpress.com
> >  - Co-Founder @ http://www.jbug.com.ar
> >
> >  - Salatino "Salaboy" Mauricio -
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> _______________________________________________
> 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/20100715/b178c886/attachment.html 


More information about the rules-users mailing list