<br>&nbsp;&nbsp; Natraj,<br><br>&nbsp;&nbsp; What you described are all limitations of drools 3. They are all solved now in drools 4, but not much we can do in 3.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/7/18, Natraj Gudla &lt;
<a href="mailto:natraj.forums@gmail.com">natraj.forums@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hi All,
</div>
<div>&nbsp;</div>
<div>I am using Drools 3.0.6 and unable to perform some simple form of multiplication. I want to compare an object field with another field multiplied by a factor.</div>
<div>&nbsp;</div>
<div><b><font color="#960000" size="2">
<p align="left">rule</p></font></b><font size="2"> </font><font color="#008000" size="2">&quot;<strong>Calculate</strong> Business profit,1&quot;<br></font><font color="#960000" size="2"><strong>when<br><br></strong></font>

<font size="2"><strong>EMIAgainstProperty</strong> ( bp1 : businessProfit1 )<br>emi : <strong>EMIAgainstProperty</strong> ( businessProfit2 &gt; <strong>(bp1*1.5)</strong> ) 
<p align="left"></p></font><b><font color="#960000" size="2">then<br></font></b><font size="2">emi.setBusinessProfit((emi.getBusinessProfit1()+emi.getBusinessProfit2())/2);<strong><br></strong></font><b><font color="#960000" size="2">

end</font></b>
<p align="left"><font color="#960000" size="2"><font color="#330000">I get an error on creation of the package that * is undefined for Double and double. I understand this is because Drools does an auto box on primitive type variables. But is there a work around to do simpler comparisons like this, especially on the right hand side of the condition. some thing like [ variable * constantValue ]. 
</font></font></p>
<p align="left"><font color="#960000" size="2"><font color="#330000">Also, i am forced to do a declaration for businessProfit1, and use in the comparison below. I am not able to compare two fields of the same object directly.
</font></font></p>
<p align="left"><font color="#960000" size="2"><font color="#330000">some thing like businessProfit2 &gt; businessProfit1 does not work, why is this so? Any one has faced these problems earlier?</font></font></p>
<p align="left"><font color="#960000" size="2"><font color="#330000">Thanks<br></font></font><font color="#960000" size="2"><font color="#330000">Natraj </font></font></p></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>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646
<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>