Stack dump? Version?<br>Is $gb.row and $gu.row not null? <br>Is upcharge in all selected GroupUpcharges not null?<br>-W<br><br><br><div class="gmail_quote">On 20 July 2011 18:20, mjohansen <span dir="ltr">&lt;<a href="mailto:mjohansen@lazboy.com">mjohansen@lazboy.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I&#39;m trying to create an accumulator to sum a BigDecimal. Here&#39;s what I wrote:<br>
<br>
    $upcharge : BigDecimal(  )<br>
    from accumulate( GroupUpcharges( row&gt;$gb.row &amp;&amp; row&lt;=$gu.row, $value :<br>
upcharge),<br>
                              init( BigDecimal total = BigDecimal.ZERO; ),<br>
                              action( total=total.add($value); ),<br>
                              reverse( total=total.subtract($value); ),<br>
                              result( total ) )<br>
<br>
$gb and $gu are set earlier in the WHEN clause.<br>
<br>
When I run this, it compiles successfully, but then flows up at run time<br>
with a null pointer exception. What am I doing wrong?<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/accumlator-and-BigDecimal-tp3185872p3185872.html" target="_blank">http://drools.46999.n3.nabble.com/accumlator-and-BigDecimal-tp3185872p3185872.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>
</font></blockquote></div><br>