Hi,
I have two issues with float/double constants. In both cases dialect is set to MVEL
Issue 1
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:
Example:
I have a condition like:
NumberVariable( owner == $a, name == "PTI", value > 0.5)
In the class NumberVariable the method getValue() is declared as follows:
public Number getValue();
In
the working memory I have an instance with name == "PTI" and value ==
0.9633716684527102 ( actual type of the value is Double).
And the rule consequence is not executed.
If I change it and add brackets around the constant everything works correctly:
NumberVariable( owner == $a, name == "PTI", value > (0.5) )
There is similar example in drools documentation (w/o brackets):
Cheese( type == "stilton", price < 10, age == "mature" )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?