This isn't an if statement evaluated left to right with an && between each part.
Drools uses the rete algorithm to make execution more efficient.
Put very simply (and probably inaccurately) Rete creates an evaluation tree 
where inputs are put in the top and activations come out the end.
In this case the tree would have:
One node that evaluated condition1, this node outputs a list of all the facts 
that matches it.
A node for condition 2 which outputs a list all the facts that match that 
condition.
A node for the rule, this takes the outputs of the other two nodes and produces 
an activation for each pair of items (assuming condition 1 and 2 aren't 
related).

If you had another rule with condition1 and condition3 then they would both 
share the first node greatly improving efficiency and re-evaluation time.


Thomas

> -----Original Message-----
> From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
> boun...@lists.jboss.org] On Behalf Of Saurabh Pandey
> Sent: 26 September 2011 08:15
> To: rules-users@lists.jboss.org
> Subject: Re: [rules-users] Drools all lhs execute before all the rhs, i want 
> to
> run sequentially
>
> take a simple scenario:
> when
>  condition1
>  condition2
> then
>  ...
>
> Does the condition2 gets executed even if the condition1 is false, normally it
> should not because the conditions in the when are actually combined with an
> AND. Has anywhen tried this??
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Drools-all-
> lhs-execute-before-all-the-rhs-i-want-to-run-sequentially-
> tp3368215p3368464.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users@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 
postmas...@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.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**************************************************************************************

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to