[rules-users] Accumulate / collect

Esteban Aliverti esteban.aliverti at gmail.com
Wed Nov 16 04:50:31 EST 2011


As far as I know, these 2 functions already exist in 5.1.1. Don't they?

Best Regards,

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2011/11/16 Bruno Freudensprung <bruno.freudensprung at temis.com>

> **
> 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
> - Blog @ http://ilesteban.wordpress.com
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111116/893dd13e/attachment.html 


More information about the rules-users mailing list