<div> 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> $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"><<a href="mailto:manav7574@yahoo.com">manav7574@yahoo.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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>
$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 ("$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">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>
</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">www.jboss.com</a><br>