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'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 == "PTI", value > 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 == "PTI" and value ==
0.9633716684527102 ( actual type of the value is 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 == "PTI", value > (0.5) )<br><br>There is similar example in drools documentation (w/o brackets):<br>
<pre>Cheese( type == "stilton", price < 10, age == "mature" )</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 "Determine min PRI for for PROD2" ruleflow-group "budget_calculated_variables<div id="1ekp" class="ArwC7c ckChnd">_appl"<br> when<br> $a: RetailApplication( )<br>
StringVariable(name=="prodid", value matches CONST.PROD2) <br>
then<br> insert(new NumberVariable("minPTI", 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't find this constructor when "then" 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("minPTI", 0.6, null);<br><br>Drools version: 4.04, Java version: 1.6<br><br>Thanks,<br>
<font color="#888888">
Andrey.</font></div>