<div><br></div>   Which version of MVEL are you using?<div><br></div><div>   Edson<br><br><div class="gmail_quote">2010/8/17 Manav <span dir="ltr">&lt;<a href="mailto:manav7574@yahoo.com">manav7574@yahoo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Here&#39;s the modified rule : </div>

<div> </div>
<div><div class="im">rule &quot;Test Accumulate Function&quot;<br>when<br> $p : ProductType ($name : name)<br> $min_score : Number ()<br>     from accumulate (Client (productTypeExperience.keySet contains $name,<br></div>
                   $score : productTypeExperience[$name]),<br>                       min (((ExperienceLevel)$score).value()))<div class="im"><br>then<br> System.out.println (&quot;$min_score&quot; + $min_score);<br>end</div>
</div>
<div> </div>
<div>and the runtime exception that i am getting is </div>
<div><div class="im">Caused by: org.drools.RuntimeDroolsException:<br> [Error: unable to resolve method: java.util.HashMap.$name() [arglength=0]]<br></div>[Near : {... Unknown ....}]</div>
<div> </div>
<div>Regards,<br>Manav</div>
<div><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"><div class="im"><font face="Tahoma" size="2">
<hr size="1">
<b><span style="font-weight:bold">From:</span></b> Edson Tirelli &lt;<a href="mailto:tirelli@post.com" target="_blank">tirelli@post.com</a>&gt;<br><b><span style="font-weight:bold">To:</span></b> Manav &lt;<a href="mailto:manav7574@yahoo.com" target="_blank">manav7574@yahoo.com</a>&gt;; Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&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><div><div></div><div class="h5"><div>     You can&#39;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> $min_score : Number ()<br>   from accumulate (Client (productTypeExperience.keySet contains $name,<br>                     $score : productTypeExperience[$name],<br>                     min ( ((ExperienceLevel)$score).value() ) )</div>

<div><br></div>
<div>     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>     Edson</div><br><br>
<div class="gmail_quote">2010/8/15 Manav <span dir="ltr">&lt;<a href="mailto:manav7574@yahoo.com" rel="nofollow" target="_blank">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&#39;s wrong with it. Please help.<br>
This is the sample that i am working with<br><br>rule &quot;Test Accumulate Function&quot;<br>when<br> $p : ProductType ($name : name)<br> $min_score : Number ()<br>   from accumulate (Client (productTypeExperience.keySet contains $name,<br>
                     $score :<br>((ExperienceLevel)productTypeExperience[$name]).value()),<br>              min ($score))<br>then<br> System.out.println (&quot;$min_score&quot; + $min_score);<br>end<br>Regards,<br><font color="#888888">Manav<br>
</font>
<div>
<div></div>
<div><br><br><br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" rel="nofollow" target="_blank">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com/" rel="nofollow" target="_blank">www.jboss.com</a><br>
</div></div></div></div></div><br>

      </div>
</blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>