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

Edson Tirelli tirelli at post.com
Tue Aug 21 09:21:01 EDT 2007


   Juergen,

   Yes, accumulate only supports a single source pattern. I will implement
support to multi-pattern as soon as we close the nastiest open bugs in the
next few days.

    []s
    Edson

2007/8/21, Juergen <work_registries at web.de>:
>
> 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
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070821/37aa9908/attachment.html 


More information about the rules-users mailing list