You want this rule to fire if there are less than 90 measurements labelled &quot;active movement&quot; in the<br>last 7*24*60 measurements?<br><br>The only thing I can spot is incorrect syntax in the second accumulate:<br>
   from accumulate(MertAdat(sorszam &gt; ($max_sorszam - 7 * 24 * 60), $cimke : cimke == &quot;aktiv_mozgas&quot;),<br><br>The required imports are as usual: all the classes you refer to in the rule, Adattypus and MertAdat.<br>
<br>If there are more problems, please post the error message(s).<br><br>-W<br><br><br><div class="gmail_quote">On Thu, Dec 3, 2009 at 8:04 PM, SzA84 <span dir="ltr">&lt;<a href="mailto:szepesiandras@citromail.hu">szepesiandras@citromail.hu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi!<br>
<br>
I would like to use the accumulate function in my rule. I found this:<br>
<a href="http://www.docjar.com/html/api/org/drools/compiler/PackageBuilderConfiguration.java.html" target="_blank">http://www.docjar.com/html/api/org/drools/compiler/PackageBuilderConfiguration.java.html</a><br>
<br>
but i don&#39;t know exactly, which imports I need to the package and how can I<br>
make it work.<br>
This is my rule:<br>
<br>
rule &quot;aktivitas&quot;<br>
       when<br>
               Adattipus(ertek == &quot;mozgas&quot;)<br>
<br>
               $max_sorszam : Number()<br>
                       from accumulate(MertAdat($sorszam : sorszam),<br>
                                                       max($sorszam))<br>
<br>
               $aktiv_mozgas_cimke_szam : Number(intValue &lt; 90)<br>
                       from accumulate(MertAdat(sorszam &gt; $max_sorszam - (7<br>
* 24 * 60), $cimke : cimke == &quot;aktiv_mozgas&quot;),<br>
                                                       count($cimke))<br>
       then<br>
               end<br>
<br>
<br>
Sorry for this simple question!<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n3.nabble.com/accumulate-function-help-tp67445p67445.html" target="_blank">http://n3.nabble.com/accumulate-function-help-tp67445p67445.html</a><br>
Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>