<div>Hi All,</div>
<div> </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> </div>
<div><b><font color="#960000" size="2">
<p align="left">rule</p></font></b><font size="2"> </font><font color="#008000" size="2">"<strong>Calculate</strong> Business profit,1"<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 > <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 > 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>