You're probably right.<div><br></div><div>I have modified the last rule:</div><div>----------------------------</div><div><div>rule "GoodBye"</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"><<a href="mailto:salaboy@gmail.com">salaboy@gmail.com</a>></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'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 <<a href="mailto:michalbali@gmail.com">michalbali@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> I may have found a bug with accumulate and 'modify(..)' function<br>
> call. It seems that once the modify(..) is called it indirectly<br>
> calls AccumulateFunction.init() which invalidates accumulated data.<br>
> I have included a simple test case:<br>
><br>
> I am using the latest snapshot of Drools 5.1.SNAPSHOT<br>
><br>
> I have created a sample Drools project and just modified the<br>
> Sample.drl with this:<br>
> -------------------------------------------------------------<br>
> import java.util.List;<br>
> import java.util.ArrayList;<br>
><br>
> declare Holder<br>
> list : List<br>
> end<br>
><br>
> rule "Hello World"<br>
> when<br>
> m : Message( )<br>
> then<br>
> insert(new Holder());<br>
> end<br>
><br>
> rule "GoodBye"<br>
> when<br>
> $holder : Holder( list == null )<br>
> $messages : List() from accumulate(<br>
> $message: Message(), collectList($message) )<br>
> then<br>
> System.out.println($messages); //<-- here the $messages list has<br>
> one element<br>
> modify($holder) {<br>
> setList($messages)<br>
> }<br>
> System.out.println($messages); //<-- here the $messages list is<br>
> empty<br>
> end<br>
> -----------------------------------------------------<br>
><br>
> Let me know if you need more information. I can create a JIRA if<br>
> needed.<br>
><br>
> Thank you!<br>
> Best regards,<br>
> Michal<br>
</div></div>> _______________________________________________<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>
_______________________________________________<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>