<br> Jai,<br><br> You can try:<br><br>rule "Foo check with inline eval"<br>
when<br>
Foo( eval( a - (b + c) > 0 ) )<br> then <br>
<do actions><br>
end<br><br> Or, what is better IMO:<br><br>rule "Foo check with return value predicate"<br>
when<br>
Foo( a > ( b + c ) )<br>
then <br>
<do actions><br>
end<br>
<br> Hope it helps.<br><br> []s<br> Edson<br><br><br><div><span class="gmail_quote">2008/3/4, Jai Vasanth <<a href="mailto:jaivasanth@gmail.com">jaivasanth@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br><br> Suppose I have a class Foo with integers a, b and c ( methods getA getB and getC respectively ) and I Want to check if an object of Foo satisfies<br><br>a - (b + c) > 0<br><br>Is this the best way I go about doing this ?<br>
<br>rule "Foo check"<br> when<br> Foo( varA : a , varB:b, varC:c )<br> eval( varA - (varB + varC) > 0 )<br> then <br> <do actions><br> end<br><br><br><br>Writing this as <br>
<br>rule "Foo check"<br>
when<br>
Foo( a - (b + c) > 0 )<br> then <br>
<do actions><br>
end<br><br>doesnt seem to work. Its not able to find the variables (a, b and c ) from the getA getB and get C methods.<br><br>Thanks<br><span class="sg"><br>Jai <br>
</span><br>_______________________________________________<br>
rules-users mailing list<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" 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> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>