If what you need is to fire just a subset of all the activated rules, you could use agenda-group attribute instead of activation-group.
You could consider using a "guard condition" e.g.rule 1whennot Solved()<Your rule 1>theninsert new Solved();....endrule 2whennot Solved()<Your rule 2>theninsert new Solved();....endIf you only want one rule per "group" then have the grouping as a member of the guard condition.I'm not sure if you can cause the processing of activations to abort.2010/9/20 Nadav Hashimshony <nadavh@gmail.com>_______________________________________________Hi
Im using drools 5 with Guvnor 5
i set up 30 Technical rules and build a package to be used by my drools-sample application.
my probelm is as followed, some rule may conflict, i want to set up a rule order and if one rule is caught then i want the drools to stop and not continue to try other rules.
ive use salience but it hasnt really done the trick.
example:
my rules:
rule "Rule-01"
salience 100
activation-group "group1"
...
System.Out.Println("caught rule 1")
....
rule "Rule-02"
salience 100
activation-group "group1"
...
System.Out.Println("caught rule 2")
....
rule "Rule-03"
activation-group "group2"
...
System.Out.Println("caught rule 3")
....
rule "Rule-04"
activation-group "group2"
...
System.Out.Println("caught rule 4")
....
actual result: lets say all 4 rules are cuaght, what i will see is as followed
ACTIVATION CREATED rule:Rule-01 activationId:Rule-01 [1] declarations:
BEFORE ACTIVATION FIRED
caught rule 1
ACTIVATION CANCELLED rule:Rule-2
ACTIVATION CREATED rule:Rule-03 activationId:Rule-01 [1] declarations:
BEFORE ACTIVATION FIRED
caught rule 3
ACTIVATION CANCELLED rule:Rule-3
only one rule from each activation-group will be fired, and the first group with the higher salience will fire first.
what i would like is it one rule was caught to stop trying? is it possible?
Thanks, Nadav.
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users