Well, then drop the<br>  dialect &quot;mvel&quot;<br>and write the pattern as<br>   $d : IndividualDecision( loanToVal &lt; 85.0 )<br><br>There&#39;s no visible need to use mvel. <br><br>Or eval: the simplest form for constraints is always best.<br>
<br>-W<br><br> <br><br><div class="gmail_quote">2010/4/12 Ade Timi <span dir="ltr">&lt;<a href="mailto:adeyinka.timi@nathean.com">adeyinka.timi@nathean.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

















<div link="blue" vlink="blue" lang="EN-GB">

<div>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Many thanks for the response!</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Yes it fires when I use 85.0 instead, but
it obviously shouldn’t as the condition is false. My code now looks like
this:</span></font></p><div class="im">

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p class="MsoNormal" style=""><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">rule</span></font></b><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;G2 Equity
in Asset&quot;</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>

<p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">ruleflow-group</span></font></b><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;goods&quot;</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">dialect</span></font></b><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;mvel&quot;</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">when</span></font></b><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


</div><p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            $d
: IndividualDecision(</span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">eval</span></font></b><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">($d.getLoanToValue() &lt; 85.0))</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">then</span></font></b><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            $d.setGoodCount($d.incGoodCount());</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            $d.setMessage(</span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;0065: G2: Good: Good Equity in Deal&quot;</span></font><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            </span></font><font color="olive" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: olive;">//System.out.println((Double.valueOf(&quot;85&quot;)).doubleValue());</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>
<div class="im">

<p class="MsoNormal" style=""><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            System.out.println(</span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;loanToValue: &quot;</span></font><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> + ($d.getLoanToValue()));</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p class="MsoNormal"><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">end</span></font></b><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"></span></font></p>


<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

</div><p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I still get the print output of 92000.0,
which is as I expect but I don’t expect the rule to be fired at all. The
weird thing is that when I change the condition to ‘&gt;’ which is
the true condition it never fires! I’m at a loss as to why this is
happening.</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">- Ade</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<div>

<div class="MsoNormal" style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US">

<hr align="center" size="2" width="100%">

</span></font></div>

<p class="MsoNormal"><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;" lang="EN-US">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">
<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b><span style="font-weight: bold;">On
Behalf Of </span></b>Wolfgang Laun<br>
<b><span style="font-weight: bold;">Sent:</span></b> 11 April 2010 09:11<br>
<b><span style="font-weight: bold;">To:</span></b> Rules Users List<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Double
Handling</span></font><span lang="EN-US"></span></p>

</div><div><div></div><div class="h5">

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

<p class="MsoNormal" style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">You are comparing a
double to a String (&quot;85&quot;). Although MVEL might convert strings to
numbers, I wouldn&#39;t use this without some cogent reason.<br>
<br>
Do you have this unexpected firing also when you use a double literal, i.e.,
85.0 ?<br>
<br>
-W<br>
<br>
</span></font></p>

<div>

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">2010/4/9 Ade Timi &lt;<a href="mailto:adeyinka.timi@nathean.com" target="_blank">adeyinka.timi@nathean.com</a>&gt;</span></font></p>


<div link="blue" vlink="purple">

<div>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi,</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">I am new to
Drools. I am having a problem comparing 2 double values. I have a Java class with
a double attribute called loanToValue. The loanToValue is been read from an XML
file and the value is 92000.0. Based on this value I do not expect this rule to
be fired, but for some reason it does. And the print statement returns 92000.0.
Does anyone know what I’m doing wrong? My rule looks as follows:</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">rule</span></font></b><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;G2 Equity in Asset&quot;</span></font></p>


<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">ruleflow-group</span></font></b><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;goods&quot;</span></font></p>


<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">dialect</span></font></b><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;mvel&quot;</span></font></p>


<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">when</span></font></b></p>


<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">           
$d : IndividualDecision()</span></font></p>

<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">           
Individual(</span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">eval</span></font></b><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">($d.getLoanToValue()
&lt; </span></font><font color="green" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;85&quot;</span></font><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">))</span></font></p>


<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span></font><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">then</span></font></b></p>


<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">           
System.out.println(&quot;loanToValue: &quot; + ($d.getLoanToValue()));</span></font></p>

<p class="MsoNormal"><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">end</span></font></b></p>

<p class="MsoNormal"><b><font color="#960000" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;"> </span></font></b></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Thanks,</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Ade</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><b><font color="gray" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: gray; font-weight: bold;" lang="EN-IE">Adeyinka Timi</span></font></b><font color="gray" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: gray;" lang="EN-IE"> </span></font><font color="blue" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: blue;" lang="EN-IE">|</span></font><font color="#ffaf5f" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: rgb(255, 175, 95);" lang="EN-IE"> </span></font><font color="#999999" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: rgb(153, 153, 153);" lang="EN-IE">Technical Supprt</span></font><font color="gray" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: gray;" lang="EN-IE"> </span></font><font color="blue" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: blue;" lang="EN-IE">|</span></font><font color="gray" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: gray;" lang="EN-IE"> <b><span style="font-weight: bold;">Nathean
Technologies Ltd</span></b></span></font></p>

<p class="MsoNormal"><font color="gray" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: gray;" lang="EN-IE">Registered Office 3 Lyncon Court, IDA
Science &amp; Technology Park, Snugborough
  Road, Blanchardstown, Dublin
15, Ireland<br>
<b><span style="font-weight: bold;">T +353 1 685 3001</span></b> </span></font><font color="blue" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: blue;" lang="EN-IE">|</span></font><font color="#999999" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: rgb(153, 153, 153);" lang="EN-IE"> VOIP 076 615 1117 </span></font><font color="blue" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: blue;" lang="EN-IE">|</span></font><font color="gray" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: gray;" lang="EN-IE"> <b><span style="font-weight: bold;">E <a href="mailto:adeyinka.timi@nathean.com" target="_blank">adeyinka.timi@nathean.com</a></span></b> </span></font><font color="blue" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: blue;" lang="EN-IE">|</span></font><font color="#999999" face="Arial" size="1"><span style="font-size: 8pt; font-family: Arial; color: rgb(153, 153, 153);" lang="EN-IE"> <a href="http://www.nathean.com/" title="blocked::http://www.nathean.com/" target="_blank"></a><a href="http://www.nathean.com" target="_blank"><span title="blocked::http://www.nathean.com/">www.nathean.com</span></a></span></font></p>


<p class="MsoNormal"><font color="#999999" face="Verdana" size="1"><span style="font-size: 6.5pt; font-family: Verdana; color: rgb(153, 153, 153);" lang="EN-IE">Incorporated in Ireland, No. 339972</span></font></p>

<p class="MsoNormal"><font color="#999999" face="Verdana" size="1"><span style="font-size: 6.5pt; font-family: Verdana; color: rgb(153, 153, 153);" lang="EN-IE">The information appearing in this email and
any files transmitted with it is confidential and may not be reproduced, modified,
distributed, transmitted, displayed, published or broadcast without the prior
written permission of Nathean Technologies Ltd. It is intended solely for the
use of the addressee(s). Nathean Technologies Ltd, its directors, officers and
employees do not accept liability for any loss or damage of any nature
howsoever arising pertaining to the use of information appearing in this email
and/or any files transmitted with it. Whilst this email has been checked for
the presence of computer viruses, Nathean Technologies Ltd does not, except as
required by law, represent, warrant and/or guarantee that the integrity of this
communication has been maintained nor that the communication is free of errors,
viruses, interception or interference.</span></font></p>

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

</div>

</div>

<p class="MsoNormal" style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></span></font></p>

</div>

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

</div></div></div>

</div>


<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a 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>