<div class="gmail_quote"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Hello, <div>I&#39;ve 2 rules which should be similar but the result is different and I can&#39;t understand why :</div>
<div><br></div><div>I insert an object Message() into drools with the following rule :</div><div><br></div><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
<div><div>rule &quot;rule_a&quot;</div></div><span style="white-space: pre-wrap; ">        </span>timer (int:1s 1s) <div><div><span style="white-space: pre-wrap; ">        </span>when </div></div><div><div><span style="white-space: pre-wrap; ">                </span>SimpleClock ( d : dateInMillisec != 0 )  // SimpleClock give the current time (set by a java timer and an update)</div>
</div><div><div><span style="white-space: pre-wrap; ">                </span>m : Message ( internalEndDate &lt; d )</div></div><div><div><span style="white-space: pre-wrap; ">        </span>then </div></div><div><div><span style="white-space: pre-wrap; ">        </span><span style="white-space: pre-wrap; ">        </span>System.out.println( &quot;rule a&quot;);</div>
<div><span style="white-space: pre-wrap; "></span></div></div><div><div><span style="white-space: pre-wrap; ">                </span>m.setInternalEndDate (d + 10000); </div></div><div><div><b><span style="white-space: pre-wrap; ">                </span>retract (m);</b></div>
</div><div><div><b><span style="white-space: pre-wrap; ">                </span>insert (m);</b></div></div><div><div>end</div></div></blockquote><div><br></div><div>&gt; the result is fine : a message every 10.</div><div><br></div><div>
If I replace the rule_a by the rule_b : (because an update should be better than an retract/insert I guess)</div><div><br></div><div><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
<div><div>rule &quot;rule_b&quot;</div></div><span style="white-space: pre-wrap; ">        </span>timer (int:1s 1s)<div><div><span style="white-space: pre-wrap; ">        </span>when </div></div><div><div><span style="white-space: pre-wrap; ">                </span>SimpleClock ( d : dateInMillisec != 0 )  // Simple slock give the current time (set by a java timer and an update)</div>
</div><div><div><span style="white-space: pre-wrap; ">                </span>m : Message ( internalEndDate &lt; d )</div></div><div><div><span style="white-space: pre-wrap; ">        </span>then </div></div><div><div><span style="white-space: pre-wrap; ">        </span><span style="white-space: pre-wrap; ">        </span>System.out.println( &quot;rule b&quot;);</div>
<div><span style="white-space: pre-wrap; "></span></div></div><div><div><span style="white-space: pre-wrap; ">                </span>m.setInternalEndDate (d + 10000); </div></div><div><div><b><span style="white-space: pre-wrap; ">                </span>update (m);</b></div>
</div><div><div>end</div></div><div><br></div></blockquote></div><div><div><br></div><div>&gt; the result is bad : a message every 1 second. </div><div><br></div><div>It act as if the attibute message.internalEndDate wasn&#39;t updated in the drools engine. Could someone explain me if/why this behaviour is normal ?</div>
</div><div>Thanks in advance</div><div><br></div><div>Marc</div></span></div>