<br>&nbsp;&nbsp; Looks like bugs. The first one is probably in drools code, while the second one is on mvel.<br><br>&nbsp;&nbsp; Can you please open a jira for them?<br><br>&nbsp;&nbsp; Thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2008/3/1, Andrey Grin &lt;<a href="mailto:andrey.grin@gmail.com">andrey.grin@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;">
Hi,<br><br>I have two issues with float/double constants. In both cases dialect is set to MVEL<br><br>Issue 1<br><br>If
I use a comparison operator with the Double value it doesn&#39;t seem to
work correctly w/o brackets in the right part of the expression:<br>
<br>Example:<br>I have a condition like:<br>NumberVariable( owner == $a, name == &quot;PTI&quot;, value &gt; 0.5)<br><br>In the class NumberVariable the method getValue() is declared as follows:<br>
public Number getValue();<br><br>In
the working memory I have an instance with name == &quot;PTI&quot; and value ==
0.9633716684527102 ( actual type of the value is&nbsp; Double).<br><br>And the rule consequence is not executed.<br>
<br>If I change it and add brackets around the constant everything works correctly:<br><br>NumberVariable( owner == $a, name == &quot;PTI&quot;, value &gt; (0.5) )<br><br>There is similar example in drools documentation (w/o brackets):<br>


<pre>Cheese( type == &quot;stilton&quot;, price &lt; 10, age == &quot;mature&quot; )</pre>I
assume that in this example the property has a primitive type and in my
case autoboxing is involved, but why brackets are necessary in my case?<br>
<br><br>Issue 2<br><br>I have a rule:<br><br>rule &quot;Determine min PRI for for PROD2&quot;&nbsp; ruleflow-group &quot;budget_calculated_variables<div>_appl&quot;<br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $a: RetailApplication( )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; StringVariable(name==&quot;prodid&quot;, value matches CONST.PROD2) <br>
&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; insert(new NumberVariable(&quot;minPTI&quot;, 0.6, $a));<br>end<br><br>Initially I had only one constructor for NumberVariable:<br><br>public NumberVariable(String pName, Number pValue, Object pOwner)<br>


<br>But MVEL couldn&#39;t find this constructor when &quot;then&quot; part was executed (runtime exception).<br>The problem was solved when I added another constructor:<br><br>public NumberVariable(String pName, float pValue, Object pOwner)<br>


<br>Java compiler accepts identical code when only first constructor is there:<br><br>NumberVariable nv = new NumberVariable(&quot;minPTI&quot;, 0.6, null);<br><br>Drools version: 4.04, Java version: 1.6<br><br>Thanks,<br>
<span class="sg">
<font color="#888888">
Andrey.</font></span></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;JBoss Drools Core Development<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>