[rules-users] OR operator affects how many times Rule's actionis executed

Edson Tirelli tirelli at post.com
Mon Jun 8 10:42:02 EDT 2009


   Correct. This is explained in the manual. All production rules rete-based
engines work like this, executing the rule consequence once for each logical
branch.

   []s
   Edson

2009/6/8 Anstis, Michael (M.) <manstis1 at ford.com>

> I believe the answer is that Drools implements sub-rule compilation for
> rules containing "or".
>
> So in essence your rulebase contains the following once compiled:-
>
> rule "fire_twice_a"
>         no-loop true
> when
>        eval(true)
> then
>        System.out.println("word");
> end
>
> rule "fire_twice_b"
>         no-loop true
> when
>        eval(true)
> then
>        System.out.println("word");
> end
>
>
> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org
> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of
> sergey.olifirenko
> Sent: 08 June 2009 13:39
> To: rules-users at lists.jboss.org
> Subject: Re: [rules-users] OR operator affects how many times Rule's
> actionis executed
>
>
> More simple example:
>
>
> package continuated_rules
>
> dialect "mvel"
>
> rule "fire_twice"
>        no-loop true
> when
>        eval(true) or eval(true)
> then
>        System.out.println("word");
> end
>
> output is:
>
> word
> word
>
> why does it happens ?
>
> --
> View this message in context:
> http://www.nabble.com/OR-operator-affects-how-many-times-Rule%27s-action
> -is-executed-tp23910106p23923259.html<http://www.nabble.com/OR-operator-affects-how-many-times-Rule%27s-action%0A-is-executed-tp23910106p23923259.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
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090608/d8b4d23e/attachment.html 


More information about the rules-users mailing list