I think that you can explore the options already suggested:<br><br>- guard condition<br>- agenda group<br><br>and also:<br><br>- no-loop, if you happen to have any rule looping around itself<br>- drools.halt( ) in the consequence, if you want to completely halt the execution when a given rule matches.<br>
<br>Cheers,<br>Leo.<br><br><br><br><div class="gmail_quote">2010/9/21 Esteban Aliverti <span dir="ltr"><<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
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.<div><br></div><div>Best,<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
<br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">2010/9/20 Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
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" target="_blank">nadavh@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div>
<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></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></div></div><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>