Assignment to BigDecimal type property causes compilation errors in executable model.

Solution Unverified - Updated -

Issue

Building a rule which is described in MVEL dialect and contains an assignment statement to BigDecimal type property in executable rule model causes compilation errors.

When I build a maven project which contains rules using an assignment statement to BigDecimal type property like (*1) with executable model enabled,

package com.example.reproducer

import com.example.reproducer.Bus

dialect "mvel"

rule "bus3a"
    when
        $bus : Bus()
    then
        modify($bus) {
            weight = 13000    // ..... (*1)
        }
        System.out.println("***** " + $bus + ", weight = " + $bus.weight);
end

// weight is a BigDecimal type property of Bus class.

compilation errors occur with the messages like below.

$ mvn clean compile -DgenerateModel=YES
...
[ERROR] /work2/testdir/reproducer_model_compiler_3a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P23/LambdaConsequence23B3ED62B695E9AEA44284D670FC4A7C.java:[20,13] weight has private access in com.example.reproducer.Bus
[ERROR] /work2/testdir/reproducer_model_compiler_3a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P23/LambdaConsequence23B3ED62B695E9AEA44284D670FC4A7C.java:[20,23] incompatible types: int cannot be converted to java.math.BigDecimal
...

Environment

  • Red Hat Decision Manager (RHDM)
    • 7.5.0 - 7.9.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In