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. _______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
