<div>&nbsp;</div>
<div>Hi,</div>
<div>&nbsp;</div>
<div>Yes.</div>
<div>&nbsp;</div>
<div>1.</div>
<div>Define a static method in java and import the specific function in rule file.</div>
<div>&nbsp;</div>
<div>DroolsFunction.java</div>
<div>-----------------------------</div>
<div>public static boolean isValidForBrand() {...}</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>2. import the java function in rule file</div>
<div>invokeRule.drl</div>
<div>&nbsp;</div>
<div>import function DroolsFunction.isValidForBrand;</div>
<div>&nbsp;</div>
<div>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">when</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">&nbsp;exists (</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">Boolean(booleanValue==true) from isValidForBrand($croNumberDetailsRequest.getBrand())</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">)</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">Then</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">ResultList.add($resdirectPhoneNumber);</span></font></p></div>
<div>&nbsp;</div>
<div>Try this, It should work.</div>
<div><br>Regards,</div>
<div>Riyaz<br>&nbsp;</div>
<div><span class="gmail_quote">On 9/11/08, <b class="gmail_sendername">Rout, Sushanta (ThoughtMill)</b> &lt;<a href="mailto:Sushanta.Rout@ihg.com">Sushanta.Rout@ihg.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div lang="EN-US" vlink="blue" link="blue">
<div>
<p><font face="Arial" color="blue" size="2"><span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Is there any way to call java functions in the rule? One option is <b><span style="FONT-WEIGHT: bold">eval </span></b>but eval is quite expensive. Hence trying to see if there is any other option?</span></font></p>

<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">when</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">Eval($resdirectPhoneNumber.isValidForBrand($croNumberDetailsRequest.getBrand()))</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">Then</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">ResultList.add($resdirectPhoneNumber);</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">&nbsp;</span></font></p>
<p><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: black">Thanks</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>