[rules-users] accumlator and BigDecimal

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jul 20 13:57:42 EDT 2011


Stack dump? Version?
Is $gb.row and $gu.row not null?
Is upcharge in all selected GroupUpcharges not null?
-W


On 20 July 2011 18:20, mjohansen <mjohansen at lazboy.com> wrote:

> I'm trying to create an accumulator to sum a BigDecimal. Here's what I
> wrote:
>
>    $upcharge : BigDecimal(  )
>    from accumulate( GroupUpcharges( row>$gb.row && row<=$gu.row, $value :
> upcharge),
>                              init( BigDecimal total = BigDecimal.ZERO; ),
>                              action( total=total.add($value); ),
>                              reverse( total=total.subtract($value); ),
>                              result( total ) )
>
> $gb and $gu are set earlier in the WHEN clause.
>
> When I run this, it compiles successfully, but then flows up at run time
> with a null pointer exception. What am I doing wrong?
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/accumlator-and-BigDecimal-tp3185872p3185872.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110720/cc53a11e/attachment.html 


More information about the rules-users mailing list