<p>Your first rule matches against the Customer, as does the second. The modify in the first rule causes both rules to re-evaluate. The first does not match but the second does.</p>
<p>IIRC no-loop or lock-on-active can be uses to avoid this, but I&#39;d suggest you double check the docs.</p>
<p>sent on the move</p>
<p>On 30 Oct 2011 19:31, &quot;elsdestickere&quot; &lt;<a href="mailto:elsdestickere@yahoo.com">elsdestickere@yahoo.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
The Expert documentation says &quot; a rule may fire once or several times&quot;, but<br>
I don&#39;t understand why a rule sould fire several times if the objects state<br>
does not change?<br>
<br>
I have an example of a Customer object inserted in the Working Memory, with<br>
2 rules that should fire, but the last rule fires twice.<br>
Can someone explain?<br>
<br>
rule &quot;isAdult&quot;<br>
    when<br>
        k : Customer( age(date)&gt;=18, adult==false );<br>
    then<br>
        modify( k ) { setAdult(true)  };<br>
        System.out.println( &quot;Drools &quot;+drools.getRule().getName()+&quot;: &quot;+<br>
k.getAdult() );<br>
end<br>
rule &quot;WM&quot;<br>
    when<br>
       k : Customer(  ) ;<br>
    then<br>
        System.out.println( &quot;Drools &quot;+drools.getRule().getName()+&quot;: &quot;<br>
+k.getName());<br>
end<br>
<br>
...<br>
Customer bert = new Customer ();<br>
bert.setName(&quot;Bert&quot;);<br>
bert.setDate(30);<br>
ksession.insert(bert);<br>
ksession.fireAllRules();<br>
...<br>
Output:<br>
Drools WM: Bert<br>
Drools isAdult: true<br>
Drools WM: Bert<br>
<br>
Br,<br>
Els Destickere<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/rule-fires-several-times-tp3466250p3466250.html" target="_blank">http://drools.46999.n3.nabble.com/rule-fires-several-times-tp3466250p3466250.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</blockquote></p>