[rules-users] Evaluation of the of rules with 'window:length' event windows

Wolfgang Laun wolfgang.laun at gmail.com
Wed May 16 08:08:44 EDT 2012


On 16/05/2012, Vincent LEGENDRE <vincent.legendre at eurodecision.com> wrote:
>>
>>   accumulate( Whatever(...), $count: count(1), ... )
>>   eval( $count == X )
>
> strange construction ...
> "$count: count(1)" is part of the pattern ? then automatically incremented
> in $count variable ?
> Does the accumulate still return a List or something else ?

If you want to have a list, you can have it in addition to count:
   accumulate( $w: Whatever(...) from window:length( 10 ),
                        $count: count(1), $list: collectList( $w ),... )
although that would be redundant. But if you'd just need the (for
instance) sum, it would be useful.
  accumulate( Whatever( $x:x, ... ) from window:length( 10 ),
                        $count: count(1), $sum: sum( $x ) )

Note that this is a *complete* CE, beginning with "accumulate".

-W

> _______________________________________________
> 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