The drl test case below illustrates a problem with math inside of drools when using the mvel dialect. When using autoboxing the order of operations (and parens)  are not respected. This is using drools 5.0M1 and mvel-2.0-dp4.jar. The correct answer is 80 and the answer provided with autoboxing in the mvel dialect is 100.

 

I’m uncertain of how to create a viable test case in pure mvel to add it to their jira. Any help is appreciated,

 

Thanks,

 

Joe

 

 

package test;

 

dialect "mvel"

 

rule "TestRule"

      when

      then

           

            double value=(2*new Double("50"))-10-10;

            System.out.println(value);

           

            double valueTwo=(2*50)-10-10;

            System.out.println(valueTwo);

End

 

RESULTS

Wrong = 100.0

Right = 80.0