One simple way is:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [when] condition3 = not condition2 &amp;&amp; \\someCondition;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[then] assert the Object2 into Working Memory;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[when] condition4 = not condition2 &amp;&amp; \\someCondition;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[then] Set the Error Message.<br><br>Generally you should keep your rules independent of each other. <br><br>If this is just a naive example of a more complex problem maybe you should look at the RuleFlow (in v4) or agenda groups.
<br><br><div><span class="gmail_quote">On 6/22/07, <b class="gmail_sendername">McShiv</b> &lt;<a href="mailto:rajesh_sachin10@yahoo.co.in">rajesh_sachin10@yahoo.co.in</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi,<br><br>I am using Drools 3.0.6. The rule is given below.<br><br>Rule:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[when] condition1 = \\someCondition;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[then] assert the Object1 into Working Memory;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[when] condition2 = \\someCondition;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[then] set the Error Message.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[when] condition3 = \\someCondition;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[then] assert the Object2 into Working Memory;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[when] condition4 = \\someCondition;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[then] Set the Error Message.
<br><br>By requirement is when the condition2 is satisfied, the error code should be<br>set and the following rules should not fire. If the condition2 is not<br>satisfied, it goes to the condition3 and condition4. If condition4
<br>satisfies, it should set the error code and stop firing the rules again.<br><br>I dont know how to stop the rules from firing after the error code is set in<br>the condition2.<br><br>Can someone help me on this issue.
<br><br>Thanks &amp; Regards<br>McShiv.........<br>--<br>View this message in context: <a href="http://www.nabble.com/How-to-stop-a-rule-from-firing--tf3961519.html#a11242241">http://www.nabble.com/How-to-stop-a-rule-from-firing--tf3961519.html#a11242241
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br><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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams
<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br><a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br><a href="http://www.objectconsulting.com.au">
www.objectconsulting.com.au</a><br><br>consulting | development | training | support<br>our experience makes the difference