<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
look at hte Shopping Example, I use sum() there, but the concept is the
same:<br>
<br>
rule "determine 10% discount if total purcahses is over 100"           
<br>
    no-loop true    <br>
    when<br>
        $c : Customer()<br>
        $i : Double(doubleValue  &gt; 100) from accumulate ( Purchase(
customer == $c, $price : product.price ), <br>
                                                                   
sum( $price ) )<br>
    then<br>
          $c.setDiscount( 10 );<br>
        insertLogical( new Discount($c, 10) );    <br>
end<br>
<br>
Mark<br>
<a class="moz-txt-link-abbreviated" href="mailto:tom@bergstein-soraic.de">tom@bergstein-soraic.de</a> wrote:
<blockquote
 cite="mid:689967.9581185612185931.JavaMail.servlet@pustefix150.kundenserver.de"
 type="cite">Does anybody have a good example about using count()?
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>