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-tp3185872p318...
Sent from the Drools: User forum mailing list archive at
Nabble.com.