<br> In your case, best seems to be to use a return value restriction:<br><br>MyClass( <font face="Courier New" size="2"><span style="font-size: 10pt;">$brotherDOB : </span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">
brotherDOB != null, yearBorn < (</span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">date.yearOfDate($</span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">
brotherDOB</span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">)-{years}) )<br><br> []s<br> Edson<br></span></font><br><div><span class="gmail_quote">2007/8/22, Saleem Lakhani <
<a href="mailto:Saleem.Lakhani@citizensfla.com">Saleem.Lakhani@citizensfla.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;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi,</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">What is the best way of writing such a rule in drools 4.0 without
using eval ? In the following rule 'date' is a global variable for
my own dateUtil class and {year} is the variable I will pass.</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Courier New" size="2"><span style="font-size: 10pt;">brotherDOB != null, $brotherDOB : brotherDOB</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">eval(boy.getYearBorn() < (date.yearOfDate($</span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">brotherDOB</span>
</font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">)-{years}))</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Trebuchet MS" size="2"><span style="font-size: 10pt;">Saleem Lakhani</span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
</div>
</div>
<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> Software Engineer - JBoss Rules Core Developer<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>