One simple way is:

      [when] condition3 = not condition2 && \\someCondition;
      [then] assert the Object2 into Working Memory;

      [when] condition4 = not condition2 && \\someCondition;
      [then] Set the Error Message.

Generally you should keep your rules independent of each other.

If this is just a naive example of a more complex problem maybe you should look at the RuleFlow (in v4) or agenda groups.

On 6/22/07, McShiv <rajesh_sachin10@yahoo.co.in> wrote:

Hi,

I am using Drools 3.0.6. The rule is given below.

Rule:

      [when] condition1 = \\someCondition;
      [then] assert the Object1 into Working Memory;

      [when] condition2 = \\someCondition;
      [then] set the Error Message.

      [when] condition3 = \\someCondition;
      [then] assert the Object2 into Working Memory;

      [when] condition4 = \\someCondition;
      [then] Set the Error Message.

By requirement is when the condition2 is satisfied, the error code should be
set and the following rules should not fire. If the condition2 is not
satisfied, it goes to the condition3 and condition4. If condition4
satisfies, it should set the error code and stop firing the rules again.

I dont know how to stop the rules from firing after the error code is set in
the condition2.

Can someone help me on this issue.

Thanks & Regards
McShiv.........
--
View this message in context: http://www.nabble.com/How-to-stop-a-rule-from-firing--tf3961519.html#a11242241
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference