Not sure exactly what you mean with the "etc". in "no global flags etc" but you could use a declared control fact, for example:

declare CF
    ruleName : String
end

rule "A1"
    salience 100
    when
        xxx1
        not CF( ruleName == "A1"  )
    then
        yyy1
        CF cf = new CF();
        cf.setRuleName("A2");
        insert(cf);   
end

rule "A2"
    salience 90
    when
        xxx2
        not CF( ruleName == "A2"  )
    then
        yyy2
        CF cf = new CF();
        cf.setRuleName("A1");
        insert(cf);
end
On 12/16/10 10:44 AM, Yaniv Itzhaki wrote:
any ideas anyone?

On Thu, Dec 16, 2010 at 12:36 PM, Yaniv Itzhaki <iyaniv@gmail.com> wrote:
Hi,

I have a group of rules with salience which I would like that only the first activated rule will fire.

I cant use the activation-group attribute because each rule can fire number of times, and i want only this rule to be fired in that group:

rule "A1"
salience 100
ruleflow-group "A"
activation-group "A"
when
        xxx1
then
       yyy1
end

rule "A2"
salience 90
ruleflow-group "A"
activation-group "A"
when
        xxx2
then
       yyy2
end

If Rule A1 run (activated number of times), rule A2 should not run.

Is there a way to do that? (no global flags etc.)

Thanks
Yaniv

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