<br>    Also, if each of your steps involve multiple rules, the best way to coordinate &quot;phased&quot; execution is to use ruleflow.<br><br>    Edson<br><br><div class="gmail_quote">2009/11/23 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Without salience, there is no guarantee that rule 1 will fire before rule 2.<br>
<br>
Seeing only part of the problem makes it difficult to shell out good advice.<br>
<font color="#888888"><br>
-W<br>
</font><div><div></div><div class="h5"><br>
On 11/23/09, Greg Barton &lt;<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>&gt; wrote:<br>
&gt; The reason rule 2 is executed even though rule 1 has fired is because you&#39;re<br>
&gt; not notifying the engine that the CustomerDetail has been changed.  You need<br>
&gt; the statement &quot;update(d)&quot; in the rule action. (And this is generally true<br>
&gt; when you modify matched objects in a rule.  Only leave it out in the rare<br>
&gt; circumstance when you do NOT want other rules to be triggered by a change.)<br>
&gt;<br>
&gt; Also, an alternative to your approach is using agenda-group.  Check the<br>
&gt; docs.<br>
&gt;<br>
&gt; --- On Mon, 11/23/09, Lindy hagan &lt;<a href="mailto:lindyhagan@gmail.com">lindyhagan@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; From: Lindy hagan &lt;<a href="mailto:lindyhagan@gmail.com">lindyhagan@gmail.com</a>&gt;<br>
&gt;&gt; Subject: [rules-users] Could anyone suggest alternate approach<br>
&gt;&gt; To: &quot;Rules Users List&quot; &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt;&gt; Date: Monday, November 23, 2009, 11:56 AM<br>
&gt;&gt; Please ignore my previous email as I<br>
&gt;&gt; did not include subject.<br>
&gt;&gt;<br>
&gt;&gt; I have 4 drl files in my app. Loading all the 4 during<br>
&gt;&gt; application startup.<br>
&gt;&gt; If any rule is satisfied in File 1,I don&#39;t want File 2<br>
&gt;&gt; be called.Should execute File 3 and 4.<br>
&gt;&gt; Similarly If rules in File 1 is not satisfied,want to call<br>
&gt;&gt; File 2 then File 3 and 4.<br>
&gt;&gt;<br>
&gt;&gt; At present I am doing this way.Please let me know if<br>
&gt;&gt; this is ok or if there is any better solution.<br>
&gt;&gt; Set an attribute when a rule is satisfied. (attribute is<br>
&gt;&gt; not dummy,I need it in my app)<br>
&gt;&gt; Attribute is checked in each and every if it is null.<br>
&gt;&gt;<br>
&gt;&gt; Example File1.drl contains 2 rules.If first rule is<br>
&gt;&gt; satisfied, don&#39;t want to execute second rule.So setting<br>
&gt;&gt; rule with a valid number.<br>
&gt;&gt;<br>
&gt;&gt; File1.drl<br>
&gt;&gt; rule &quot;1.Age Factor and Junior&quot;<br>
&gt;&gt;      when<br>
&gt;&gt;           d : CustomerDetail( rule == &quot;&quot;<br>
&gt;&gt; &amp;&amp; sale == &#39;Junior&#39; &amp;&amp; age in<br>
&gt;&gt; (&quot;16&quot;,&quot;17&quot;))<br>
&gt;&gt;      then<br>
&gt;&gt;<br>
&gt;&gt;      System.out.println(&quot;Junior and Age Satisfied<br>
&gt;&gt; &quot;);<br>
&gt;&gt;       d.setRule(&quot;1&quot;);<br>
&gt;&gt; end<br>
&gt;&gt; rule &quot;2.Junior only Age Factor&quot;<br>
&gt;&gt;      when<br>
&gt;&gt;           m : CustomerDetail( rule == &quot;&quot;<br>
&gt;&gt; &amp;&amp; age in (&quot;16&quot;,&quot;17&quot;))<br>
&gt;&gt;      then<br>
&gt;&gt;       System.out.println(&quot;Only junior Age<br>
&gt;&gt; satisfied.&quot;);<br>
&gt;&gt;<br>
&gt;&gt;       m.setRule(&quot;2&quot;);<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt; File2.drl<br>
&gt;&gt; rule &quot;3.Age Factor and Senior&quot;<br>
&gt;&gt;      when<br>
&gt;&gt;           d : CustomerDetail( rule == &quot;&quot;<br>
&gt;&gt; &amp;&amp; sale == &#39;Senior&#39; &amp;&amp; age in<br>
&gt;&gt; (&quot;70&quot;,&quot;75&quot;))<br>
&gt;&gt;      then<br>
&gt;&gt;<br>
&gt;&gt;      System.out.println(&quot;Senior and Age Satisfied<br>
&gt;&gt; &quot;);<br>
&gt;&gt;       d.setRule(&quot;10&quot;);<br>
&gt;&gt; end<br>
&gt;&gt; rule &quot;4.Senior only Age Factor &quot;<br>
&gt;&gt;      when<br>
&gt;&gt;           m : CustomerDetail( rule == &quot;&quot;<br>
&gt;&gt; &amp;&amp; age in (&quot;70&quot;,&quot;75&quot;))<br>
&gt;&gt;      then<br>
&gt;&gt;       System.out.println(&quot;Only senior Age<br>
&gt;&gt; satisfied.&quot;);<br>
&gt;&gt;<br>
&gt;&gt;       m.setRule(&quot;11&quot;);<br>
&gt;&gt; end<br>
&gt;&gt; This one works but I see these disadvantages:<br>
&gt;&gt; 1)If the rule 1 is satisfied, rule2 is still<br>
&gt;&gt; executed.Similary all the rules in File2.drl.<br>
&gt;&gt; 2)Might impact performance all the 4 rules are called all<br>
&gt;&gt; time.<br>
&gt;&gt; Any suggestions?<br>
&gt;&gt;<br>
&gt;&gt; -----Inline Attachment Follows-----<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>