<div>Hi Yong,<br> Have you tried with retract the fact after your operation done. Like as follows<br><br>package sample</div><div><br></div><div>rule "rule 1"</div><div>when </div><div> <span style="white-space: pre-wrap;">        </span>$o:Order (amount>100 and amount<200);</div>
<div> then </div><div><span style="white-space: pre-wrap;">        </span>$o.setPrice($o.getPrice()-10);<br> retract($o);<br></div><div>end</div><div><br></div><div>rule "rule 2"</div><div>when </div><div> <span style="white-space: pre-wrap;">        </span>$o:Order (amount>200);</div>
<div> then </div><div><span style="white-space: pre-wrap;"><br>        </span>$o.setPrice($o.getPrice()-20);<br> retract($o);<br></div><div>end<br><br><br>Thanks,<br>Subhas<br></div><br><br><div class="gmail_quote">2011/3/18 yong zhao <span dir="ltr"><<a href="mailto:cluncao@yahoo.com.cn">cluncao@yahoo.com.cn</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 style="font-family: 'times new roman','new york',times,serif; font-size: 12pt;">
<div>Hi</div><div><br></div><div>I just try to uses jboss rules in our projects. I met a question. for example</div><div><br></div><div>package sample</div><div><br></div><div>rule "rule 1"</div><div>when </div>
<div> <span style="white-space: pre-wrap;">        </span>$o:Order (amount>100 and amount<200);</div><div> then </div><div><span style="white-space: pre-wrap;">        </span>$o.setPrice($o.getPrice()-10);</div><div>end</div><div>
<br></div><div><div>rule "rule 2"</div><div>when </div><div> <span style="white-space: pre-wrap;">        </span>$o:Order (amount>200);</div><div> then </div><div><span style="white-space: pre-wrap;">
        </span>$o.setPrice($o.getPrice()-20);</div><div>end</div><div><br></div><div>if the fact , order's amount is 210. then the rule2 will be executed, then the rule1 will be fired . I want to stop the session once some rule is executed or how to control the rule flow. </div>
<div>thanks in advance</div><div><br></div><div>-Yong</div><div><br></div><div><br></div><div><br></div></div><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>