<br>&nbsp;&nbsp; Ck,<br><br>&nbsp;&nbsp;&nbsp; You need to think different when using forward chaining. Your data will drive the execution, not your &quot;goals&quot;.<br>&nbsp;&nbsp;&nbsp; So, the state of your facts match rule B twice, it will fire twice.<br><br>
&nbsp;&nbsp;&nbsp; &quot;Stupid&quot; example:<br><br>rule &quot;1. increment counter&quot;<br>&nbsp;&nbsp; salience 10<br>
when<br>
&nbsp;&nbsp;&nbsp; $c : Counter( value &lt; 2 )<br>
then<br>&nbsp;&nbsp;&nbsp; System.out.println( &quot;firing rule 1&quot; );<br>
&nbsp;&nbsp;&nbsp; $c.setValue( $c.getValue() + 1 );<br>&nbsp;&nbsp;&nbsp; modify( $c );<br>end<br><br>rule &quot;2. diplay counter&quot;<br>when<br>&nbsp;&nbsp;&nbsp; Counter( $value : value )<br>then<br>&nbsp;&nbsp;&nbsp; System.out.println(&quot;Value = &quot;+$value);<br>end<br>
<br>&nbsp;&nbsp; If you do:<br><br>wm.assertObject( new Counter( 0 ) );<br>wm.fireAllRules();<br><br>&nbsp;&nbsp;&nbsp; Rules will fire:<br><br>1 -&gt; 1 -&gt; 2<br><br>&nbsp;&nbsp;&nbsp; But that is because your &quot;state&quot; (facts) drive them in that way. Do you understand that? Try removing salience attribute and check if there is any difference. Try making rule 2 higher salience than rule 1. Try asserting different values for the counter, like new Counter( 2 ).
<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br> <br><div><span class="gmail_quote">2007/5/9, ch4nd4n &lt;<a href="mailto:chandan_kumar@msn.com">chandan_kumar@msn.com</a>&gt;:</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>is there a possibility to fire a particular rule twice?<br><br>For example if I have Rules &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot; and I am putting a Person<br>Object with few parameters,<br>
<br>Then how can I fire in following order<br><br>A -&gt; B -&gt; C -&gt; B -&gt; D<br><br>Thanks,<br>Ck<br><a href="http://www.gfour.net">http://www.gfour.net</a><br>--<br>View this message in context: <a href="http://www.nabble.com/reuse-a-rule-already-fired-tf3714857.html#a10391552">
http://www.nabble.com/reuse-a-rule-already-fired-tf3714857.html#a10391552</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>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ 
<a href="http://www.jboss.com">www.jboss.com</a>