rule "get big shapes by color"
when
$map: Map()
from accumulate ( $shape: Shapes( $color: color, size > 5 ),
init( Map m = new HashMap(); ),
action( List list = m.get( $color );
if( list == null ) list = new ArrayList();
list.add( shape ); ),
result( m ) )
then
// process $map to get all lists of same color
end
Untested.
-W
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
To unsubscribe from Collect with same value,
click here.