<br> For arbitrary method calls, the only way is to use an eval:<br><br>VO( eval( computePrice("key") < 10 ) )<br><br> Although, if you have a method that returns a map, you can use simplified Map syntax:<br>
<br>class VO {<br> ...<br> public Map getComputeMap() {...}<br>}<br><br> Then:<br><br>VO( computeMap["key"] < 10 )<br><br><br> []s<br> Edson<br><br><div class="gmail_quote">2009/6/1 Vidya Chandrasekaran <span dir="ltr"><<a href="mailto:aydiv.c@gmail.com">aydiv.c@gmail.com</a>></span><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 am fairly new to Drools and am just getting my feet wet with writing rules. <br>
<br>In my work, I have to integrate drools with classes that do not expose all properties via getXXX/ isXXX accessor methods but require a call of the form someMethod("keyvalue"). I have been using the MVEL dialect and do not see a way to call a function with arguments on the LHS side of a rule either in the documentation or the mailing list.<br>
<br><br>In fact, I have been trying something like<br><br>rule "rulename"<br> agenda-group "evaluation" <br>when<br> $d: VO( computePrice("key") < 10) from entry-point "Inventory stream" <br>
then <br> # <br>end<br><br>This fails with a 'no viable alternative at input '"key"' in rule. Is there a way this can be accomplished?<br><br>Thanks,<br><font color="#888888">Vidya<br>
</font><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>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>