You&#39;re probably right.<div><br></div><div>I have modified the last rule:</div><div>----------------------------</div><div><div>rule &quot;GoodBye&quot;</div><div>no-loop true</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>when</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>$holder : Holder( )</div><div>                ...</div><div>-------------------------------</div></div><div>and it now works as expected.</div><div><br></div>
<div>However, this is still an issue...</div><div><br></div><div>Best regards,</div><div>Michal</div><div><br><br><div class="gmail_quote">On Wed, May 12, 2010 at 2:25 PM, Salaboy <span dir="ltr">&lt;<a href="mailto:salaboy@gmail.com">salaboy@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Could be that the modify make the rule condition to be no longer true,<br>
and for that reason the acumulation is zero in that point? I would<br>
like to try it but I&#39;m in my cell phone.<br>
<br>
- Ing. Mauricio Salatino -<br>
<div><div></div><div class="h5"><br>
On May 12, 2010, at 6:58, Michal Bali &lt;<a href="mailto:michalbali@gmail.com">michalbali@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi,<br>
&gt;<br>
&gt; I may have found a bug with accumulate and &#39;modify(..)&#39; function<br>
&gt; call. It seems that once the modify(..) is called it indirectly<br>
&gt; calls AccumulateFunction.init() which invalidates accumulated data.<br>
&gt; I have included a simple test case:<br>
&gt;<br>
&gt; I am using the latest snapshot of Drools 5.1.SNAPSHOT<br>
&gt;<br>
&gt; I have created a sample Drools project and just modified the<br>
&gt; Sample.drl with this:<br>
&gt; -------------------------------------------------------------<br>
&gt; import java.util.List;<br>
&gt; import java.util.ArrayList;<br>
&gt;<br>
&gt; declare Holder<br>
&gt;   list : List<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;Hello World&quot;<br>
&gt;       when<br>
&gt;               m : Message( )<br>
&gt;       then<br>
&gt;               insert(new Holder());<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;GoodBye&quot;<br>
&gt;       when<br>
&gt;               $holder : Holder( list == null )<br>
&gt;               $messages : List() from accumulate(<br>
&gt;                       $message: Message(), collectList($message) )<br>
&gt;       then<br>
&gt;               System.out.println($messages); //&lt;-- here the $messages list has<br>
&gt; one element<br>
&gt;               modify($holder) {<br>
&gt;                       setList($messages)<br>
&gt;               }<br>
&gt;               System.out.println($messages); //&lt;-- here the $messages list is<br>
&gt; empty<br>
&gt; end<br>
&gt; -----------------------------------------------------<br>
&gt;<br>
&gt; Let me know if you need more information. I can create a JIRA if<br>
&gt; needed.<br>
&gt;<br>
&gt; Thank you!<br>
&gt; Best regards,<br>
&gt; Michal<br>
</div></div>&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>
_______________________________________________<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></div><br></div>