[rules-users] from accumulate($somevar)?

ljnelson ljnelson at gmail.com
Fri May 21 13:38:38 EDT 2010



Esteban wrote:
> 
> I don't know If I understood well, but did you try this?
> 
> when
>  $xs : ArrayList() from collect(X())
>  $total : Number() from accumulate(X($c: count), sum($c))
> 
> The accumulate will iterate over all the X and calculate the sum.
> 

Yes, that was the solution I happened on, but I wanted to make sure that
this wasn't doing unnecessary duplicate work.  To my naive eyes, it looks
like two "from"s result in duplicate work.  I take it that's not true?

Best,
Laird
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/from-accumulate-somevar-tp834882p834924.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list