This isn't quite right:
You can't use the cast and the method call in a regular constraint. You can use it as part of an expression. So:$min_score : Number ()$score : productTypeExperience[$name],
from accumulate (Client (productTypeExperience.keySet contains $name,
min ( ((ExperienceLevel)$score).value() ) )
We are working on the support of free form expressions on constraints for Drools 6 (not sure we can make it for 5.2).Edson2010/8/15 Manav <manav7574@yahoo.com>Hi,
I am trying my hand at the accumulate function in Drools 5.x but the drl fails
to compile.
Not sure what's wrong with it. Please help.
This is the sample that i am working with
rule "Test Accumulate Function"
when
$p : ProductType ($name : name)
$min_score : Number ()
from accumulate (Client (productTypeExperience.keySet contains $name,
$score :
((ExperienceLevel)productTypeExperience[$name]).value()),
min ($score))
then
System.out.println ("$min_score" + $min_score);
end
Regards,
Manav
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users