<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi ,</DIV>
<DIV>&nbsp;&nbsp; i can suggest one more way to solve it. Dont create instance in when part.</DIV>
<DIV>Instead of better you convert that helper class method as static methods.</DIV>
<DIV>So that u can call that method directly . but before that u should import that helper class in drl file.</DIV>
<DIV>&nbsp;&nbsp; Or second way u can directly write a method in ur drl file itself.</DIV>
<DIV><BR>Example :</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;<B><FONT color=#960000 size=2></DIV>
<DIV>import</B></FONT><FONT size=2> com.g2x.agility.leads.workflow.rulesengine.RuleUtilities;</DIV>
<DIV></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>rule"ConvertRule"</DIV>
<DIV>&nbsp;</DIV>
<DIV>when </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eval ( RuleUtilities.getStringToInteger( age) &gt; 40)</DIV>
<DIV>// getStringToInteger(String age) is static method</DIV>
<DIV>&nbsp;</DIV>
<DIV>then </DIV>
<DIV>&nbsp;&nbsp;&nbsp; System.out.print("XXXXName");</DIV>
<DIV>&nbsp;</DIV>
<DIV>end</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR></DIV>
<DIV><FONT color=#0000ff><EM><STRONG>
<DIV>
<DIV class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"><FONT color=#aa4d4e>Defeat yourself today!</FONT></SPAN></FONT></DIV></DIV>
<DIV>
<DIV class=MsoNormal><B><FONT face="Palatino Linotype" color=maroon size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Palatino Linotype'">____________________________</SPAN></FONT></B><FONT color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black"> </SPAN></FONT><FONT face=Arial color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"><BR></SPAN></FONT></DIV></DIV></STRONG></EM></FONT>&nbsp;&nbsp;&nbsp; <STRONG><EM><FONT color=#c49b71>DILIP&nbsp; KUMAR.M</FONT></EM></STRONG></DIV><BR><BR>--- On <B>Tue, 2/12/08, vanshi <I>&lt;nilu.thakur@gmail.com&gt;</I></B> wrote:<BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: vanshi &lt;nilu.thakur@gmail.com&gt;<BR>Subject: [rules-users] Inline eval problem!<BR>To: rules-users@lists.jboss.org<BR>Date: Tuesday, 2 December, 2008, 10:38 AM<BR><BR><PRE>I need to convert a variable from string to intger in the rule. That variable
here is rank, so, I create a helper class called 'Conversion' with just
one
function/method, which is supposed to convert the string argument passed to
it, to an integer and then I call that method in rule as inline eval.
What's
wrong here because this is not working and I don't want to change
'When'
part too much because it has 10 or so other variable with &amp;&amp;
connective,
which I've removed for clarity here. Any input would be appreciated much.

package harules;
import com.hibernate.Person;
import com.uhg.utils.Conversion;

rule "one"
salience 10
        when
        $con: Conversion();
        pers: Person(age!= null , age &gt;= 18 , eval($con.getInteger(rank) &gt; 140))
        then
        System.out.println("Evaluated true");
end

//content of Conversion class
package com.utils;
public class Conversion {
public Integer getInteger(String s)
{
        return Integer.parseInt(s);
}
}
-- 
View this message in context:
http://www.nabble.com/Inline-eval-problem%21-tp20786253p20786253.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</PRE></BLOCKQUOTE></td></tr></table><br>
      <!--6--><hr size=1></hr> Add more friends to your messenger and enjoy! <a href="http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/"> Invite them now.</a>