[rules-users] Accumulate / collect
Bruno Freudensprung
bruno.freudensprung at temis.com
Wed Nov 16 04:46:07 EST 2011
Hi Wolfgang, hi Estaban,
Many thanks for your insights!
I'll stick to a custom accumulate function since it is more consice than
the init/action/result approach.
And since I am using Drools 5.1.1, I'll create functions named
collectList and collectSet to be "future proof" :-)
Best regards,
Bruno.
Le 16/11/2011 10:34, Esteban Aliverti a écrit :
> You already have 2 accumulate functions to do what you need:
>
> * collectList
> * collectSet
>
> So, your rule will look like this:
> $countries : HashSet(empty == false) from accumulate (City($name
> matches "X.*", $country : country), collectSet($country))
>
>
> Best Regards,
>
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>
> Esteban Aliverti
> - Developer @ http://www.plugtree.com <http://www.plugtree.com>
> - Blog @ http://ilesteban.wordpress.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111116/520e06f5/attachment.html
More information about the rules-users
mailing list