<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I believe all your requests are in 4.0, give that a try. For 2.0.6
you'll have to unwrap<br>
&gt; (bpl.doubleValue() * 1.5 )<br>
<br>
Mark<br>
Natraj Gudla wrote:
<blockquote
 cite="mid:d55672f70707180128m78d56b3cy5bbd436ee4749eaa@mail.gmail.com"
 type="cite">
  <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">"<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 &gt; <strong>(bp1*1.5)</strong>
) </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>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>