<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>&nbsp;</DIV>
<DIV>Am using 2.0.10 (mvel2-2.0.10.jar) . That's giving the issue below.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Also tried it with other versions mvel2-2.0.16.jar , mvel2-2.0.17.jar but no luck.</DIV>
<DIV>&nbsp;</DIV>
<DIV>regards,</DIV>
<DIV>Manav</DIV>
<DIV><FONT face=Tahoma size=2>&nbsp;
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Edson Tirelli &lt;tirelli@post.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Manav &lt;manav7574@yahoo.com&gt;; Rules Users List &lt;rules-users@lists.jboss.org&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [rules-users] Accumulate in Drools</FONT><BR></DIV>
<DIV>&gt;&nbsp;&nbsp; Which version of MVEL are you using?<BR>&gt;<BR>&gt;&nbsp; Edson<BR>&gt;<BR>&gt;2010/8/17 Manav &lt;manav7574 at yahoo.com&gt;<BR>&gt;<BR>&gt; Here's the modified rule :<BR>&gt;<BR>&gt; rule "Test Accumulate Function"<BR>&gt; when<BR>&gt;&nbsp; $p : ProductType ($name : name)<BR>&gt;&nbsp; $min_score : Number ()<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from accumulate (Client (productTypeExperience.keySet contains $name,<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $score : productTypeExperience[$name]),<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; min (((ExperienceLevel)$score).value()))<BR>&gt;<BR>&gt; then<BR>&gt;&nbsp; System.out.println ("$min_score" + $min_score);<BR>&gt; end<BR>&gt;<BR>&gt; and the runtime exception that i am getting is<BR>&gt; Caused
 by: org.drools.RuntimeDroolsException:<BR>&gt;&nbsp; [Error: unable to resolve method: java.util.HashMap.$name() [arglength=0]]<BR>&gt; [Near : {... Unknown ....}]<BR>&gt;<BR>&gt; Regards,<BR>&gt; Manav<BR>&gt;<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Edson Tirelli &lt;tirelli@post.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Manav &lt;manav7574@yahoo.com&gt;; Rules Users List &lt;rules-users@lists.jboss.org&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Mon, August 16, 2010 7:46:54 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [rules-users] Accumulate in Drools<BR></FONT><BR>
<DIV>&nbsp;&nbsp; &nbsp; You can't use the cast and the method call in a regular constraint. You can use it as part of an expression. So:</DIV>
<DIV><BR></DIV>
<DIV>&nbsp;$min_score : Number ()<BR>&nbsp;&nbsp;&nbsp;from accumulate (Client (productTypeExperience.keySet contains $name,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $score :&nbsp;productTypeExperience[$name],<BR>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min (&nbsp;((ExperienceLevel)$score).value()&nbsp;) )</DIV>
<DIV><BR></DIV>
<DIV>&nbsp;&nbsp; &nbsp; We are working on the support of free form expressions on constraints for Drools 6 (not sure we can make it for 5.2).</DIV>
<DIV><BR></DIV>
<DIV>&nbsp;&nbsp; &nbsp; Edson</DIV><BR><BR>
<DIV class=gmail_quote>2010/8/15 Manav <SPAN dir=ltr>&lt;<A href="mailto:manav7574@yahoo.com" target=_blank rel=nofollow ymailto="mailto:manav7574@yahoo.com">manav7574@yahoo.com</A>&gt;</SPAN><BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<BR>I am trying my hand at the accumulate function in Drools 5.x but the drl fails<BR>to compile.<BR>Not sure what's wrong with it. Please help.<BR>This is the sample that i am working with<BR><BR>rule "Test Accumulate Function"<BR>when<BR>&nbsp;$p : ProductType ($name : name)<BR>&nbsp;$min_score : Number ()<BR>&nbsp;&nbsp;&nbsp;from accumulate (Client (productTypeExperience.keySet contains $name,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $score :<BR>((ExperienceLevel)productTypeExperience[$name]).value()),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; min ($score))<BR>then<BR>&nbsp;System.out.println ("$min_score" + $min_score);<BR>end<BR>Regards,<BR><FONT color=#888888>Manav<BR></FONT>
<DIV>
<DIV></DIV>
<DIV class=h5><BR><BR><BR><BR>_______________________________________________<BR>rules-users mailing list<BR><A href="mailto:rules-users@lists.jboss.org" target=_blank rel=nofollow ymailto="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 rel=nofollow>https://lists.jboss.org/mailman/listinfo/rules-users</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>&nbsp; Edson Tirelli<BR>&nbsp; JBoss Drools Core Development<BR>&nbsp; JBoss by Red Hat @ <A href="http://www.jboss.com/" target=_blank rel=nofollow>www.jboss.com</A><BR></DIV></DIV></div><br>

      </body></html>