[rules-users] Drools 4.0, Support for multiple pattern in accumulate source pattern

Mark Proctor mproctor at codehaus.org
Tue Aug 21 09:17:52 EDT 2007


Single pattern in accumulate is all we support at the moment. Multiple 
patterns will be added for the next major release.

Multiple patterns for accumulate would be interestingly. It would 
effectively be a list of array of objects. Add a jira for it :)

Mark

Mark
Juergen wrote:
> It appears as if accumulate does support only a single pattern CE as 
> source pattern, e.g.:
>
> Number() from accumulate(
>     Cheese(
>         price : price
>     ),
>     sum( price )
> )
>
> Is it possible to have more than one pattern in the source pattern, e.g.:
>
> Number() from accumulate(
>     Cheese(
>         price : price,
>         type : type
>     )
>     Person(
>         favouriteCheese == type,
>         age > 30
>     ),
>     sum( price )
> )
>
> The same could be said for collect, but there the problem to specify 
> which item of a matching tuple is to be collected, but this could be 
> handled recreating collect via accumulate, e.g.:
>
> Collection() from accumulate(
>     cheese : Cheese(
>         type : type
>     )
>     Person(
>         favouriteCheese == type,
>         age > 30
>     ),
>     collect( cheese )
> )
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>




More information about the rules-users mailing list