look at hte Shopping Example, I use sum() there, but the concept is the same:

rule "determine 10% discount if total purcahses is over 100"           
    no-loop true   
    when
        $c : Customer()
        $i : Double(doubleValue  > 100) from accumulate ( Purchase( customer == $c, $price : product.price ),
                                                                    sum( $price ) )
    then
          $c.setDiscount( 10 );
        insertLogical( new Discount($c, 10) );   
end

Mark
tom@bergstein-soraic.de wrote:
Does anybody have a good example about using count()?

_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users