You could consider using a "guard condition" e.g.<div><br></div><div>rule 1</div><div> when</div><div> not Solved()</div><div> <Your rule 1></div><div> then</div><div> insert new Solved();</div>
<div> ....</div><div> end</div><div><br></div><div><div>rule 2</div><div> when</div><div> not Solved()</div><div> <Your rule 2></div><div> then</div><div> insert new Solved();</div>
<div> ....</div><div> end</div></div><div><br></div><div><br></div><div>If you only want one rule per "group" then have the grouping as a member of the guard condition.</div><div><br></div><div>I'm not sure if you can cause the processing of activations to abort.</div>
<div><br><div class="gmail_quote">2010/9/20 Nadav Hashimshony <span dir="ltr"><<a href="mailto:nadavh@gmail.com">nadavh@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">Hi<br><br>Im using drools 5 with Guvnor 5<br>i set up 30 Technical rules and build a package to be used by my drools-sample application.<br><br>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.<br>
<br>ive use salience but it hasnt really done the trick.<br><br>example: <br>my rules:<br><br>rule "Rule-01"<br>salience 100<br>activation-group "group1"<br>...<br>System.Out.Println("caught rule 1")<br>
....<br><br>rule "Rule-02"<br>
salience 100<br>
activation-group "group1"<br>...<br>
System.Out.Println("caught rule 2")<br>
....<br>
<br>rule "Rule-03"<br>
activation-group "group2"<br>
...<br>
System.Out.Println("caught rule 3")<br>
....<br>
<br><br>rule "Rule-04"<br>
activation-group "group2"<br>...<br>
System.Out.Println("caught rule 4")<br>
....<br>
<br><br>
actual result: lets say all 4 rules are cuaght, what i will see is as followed<br><br>ACTIVATION CREATED rule:Rule-01 activationId:Rule-01 [1] declarations: <br>BEFORE ACTIVATION FIRED <br>caught rule 1<br>ACTIVATION CANCELLED rule:Rule-2<br>
<br>ACTIVATION CREATED rule:Rule-03 activationId:Rule-01 [1] declarations: <br>
BEFORE ACTIVATION FIRED <br>
caught rule 3<br>
ACTIVATION CANCELLED rule:Rule-3<br>
<br><br>only one rule from each activation-group will be fired, and the first group with the higher salience will fire first.<br><br>what i would like is it one rule was caught to stop trying? is it possible?<br><br>Thanks, Nadav.<br>
<br><br><br><br><br><br><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>