[rules-users] rule execution order

techy techluver007 at gmail.com
Thu Nov 6 16:54:34 EST 2008


If I have r1,r2,r3, execution flow has to be
1. fire r1 first
2.then fire r2 if r1 was fired
3.then fire r3 if r1 got executed & r2 was not fired

then i can think of following way using salience and control flag.

rule r1
    salience 10
    when r1 condition
    then
    	fact.r1Executed = true
        do something
end

rule r2
     salience 9
     when fact.r1Executed == true
    then
     fact.r2Executed = true;
     do someting
end
     
rule r3
     salience 8
     fact.r1Executed == true && fact.r2Executed == true
     then 
     do something
end

I could not implement this using agenda group. Esp how to control r3 using
agenda group

Please advise if we can do it better way without using rule flow.
-- 
View this message in context: http://www.nabble.com/rule-execution-order-tp20370492p20370492.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list