Hi,
2011/1/3 Kiran Ananthpur Bacche (kbacche) <[email protected]>:
> I want the rule to fire successfully only when the TotalSalesAmount for
> _any_ given type exceeds 100.
I've never used "accumulate" myself, so I looked it up in the manual,
and there's an example that's exactly what you want :-)
(just substitute $order with your $type)
rule "Apply 10% discount to orders over US$ 100,00"
when
$order : Order()
$total : Number( doubleValue > 100 )
from accumulate( OrderItem( order == $order, $value : value ),
sum( $value ) )
then
# apply discount to $order
end
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e4893
Gabor
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users