[rules-users] Avoiding loops

Andargor andargor at yahoo.com
Fri Jul 16 09:25:37 EDT 2010


Hi,

I'm actually dealing with this issue as well. Our knowledge base is starting to grow, and we are seeing massive amounts of activations and multiple firings on rules which should only fire once. I have tried no-loop, lock-on-active, and agenda-groups, as well as messing with salience, to mixed results.

What really did help, however, was putting each rule that should only be fired once into its own activation-group (the activation-group name is the rule name). Then, they would only fire once, and performance was actually better.

My only concern is that there is a limit on the number of activation-groups, as more and more rules will be using them.

HTH,

Andargor


--- On Thu, 7/15/10, Leonardo Gomes <leonardo.f.gomes at gmail.com> wrote:

From: Leonardo Gomes <leonardo.f.gomes at gmail.com>
Subject: Re: [rules-users] Avoiding loops
To: "Rules Users List" <rules-users at lists.jboss.org>
Date: Thursday, July 15, 2010, 5:37 AM

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




-----Inline Attachment Follows-----

_______________________________________________
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/20100716/f676c96a/attachment.html 


More information about the rules-users mailing list