Compiling a rule like (*1) which is described in MVEL dialect and uses one of the four basic binary operators ('+', '-', '*', '/') taking BigDecimal type value(s) as operand(s) with executable rule models enabled, a compilation error like (*2) occurs.
(*1)
package com.example.reproducer import com.example.reproducer.Bus import java.math.BigDecimal dialect "mvel" rule "bus3b" when $bus : Bus() then // Actually, errors can occur at all the four basic operators '+', '-', '*', '/' taking BigDecimal as an operand/operands. BigDecimal grossWeight = $bus.weight + $bus.capacity * 55 + $bus.maxLoadingWeight; System.out.println("***** " + $bus + ", gross weight = " + grossWeight); end
$bus.weight and $bus.maxLoadingWeight are BigDecimal type properties.
(*2)
[ERROR] /test/reproducer_02801729_3b/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P3B/LambdaConsequence3B6B2D15753A225FFA39E42DED953773.java:[18,61] bad operand types for binary operator '+' first type: java.math.BigDecimal second type: int