[rules-users] Using count()

Mark Proctor mproctor at codehaus.org
Sat Jul 28 10:29:03 EDT 2007


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 at bergstein-soraic.de wrote:
> Does anybody have a good example about using count()?
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070728/2325b115/attachment.html 


More information about the rules-users mailing list