Have you tried using the accumulate function?

//taken from the link below and modified a bit to use count.. (it is
untested)

rule "Count the number of items in the order"
when
    $order : Order()
    $total : Number( ) 
             from accumulate( OrderItem( order == $order),  count( ) )
then
 System.out.println("There are "+$total+ " number of items in the order");

end


http://docs.redhat.com/docs/en-US/JBoss_Enterprise_SOA_Platform/4.3/html/JBoss_Rules_Reference_Guide/ch05s05s02s10.html
 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-and-ArrayList-tp3140821p3141665.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to