[rules-users] Run a set of rules in a group B from a rule in a group A

Thierry B jboss-rules at tbzone.org
Wed Jan 21 07:53:09 EST 2009


Hello,

So if I've well understand :

- before calling fireAllRules(), Drools know for all rules (from any group)
definied in DRL files, those which all patterns in the LHS of a rule are
matched, and those rules are placed on a agenda. 

At which moment exactly, Drools verified from a rule that all of its pattern
in the LHS are matched, if it's before callling fireAllRules() ?

- And fireAllRules() permit to execute all rules that are placed on agenda

- When using setFocus() from a java class or a rule, we can control the
order of rules to specify to execute rules from group B, and group C... 

- So it's not possible to tell Drools that we don't want to execute a group
of rules if a rule A is not matched : in that group of rules : those which
all paterns match LHS will be inevitably executed.

All these points that I said, are exact?

Thanks :-)


Anstis, Michael (M.) wrote:
> 
> Please accept that my knowledge is based on 4.x and there might be other
> alternatives in 5.
> 
> Rules are not "ran" but their patterns (LHS) evaluated as facts
> (objects) are inserted into Working Memory. When all patterns in the LHS
> of a rule are matched activations are placed on the agenda for execution
> of the consequence (RHS) when fireAllRules() is called (or other
> mechanisms to run what is on the agenda are invoked; such as RuleFlow).
> So you could have rules in Group A cause Group B to receive the focus
> but it is the RHS's execution order you control and not the pattern
> matching - which will happen for Group A and Group B when facts are
> inserted into WM.
> 
> Look at Agenda Groups and RuleFlow. This should help.
> 
> With kind regards,
> 
> Mike
> 
> 

-- 
View this message in context: http://www.nabble.com/Run-a-set-of-rules-in-a-group-B-from-a-rule-in-a-group-A-tp21580767p21582595.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list