Compilation error occurs for rules written in mvel dialect in executable model.

Solution Unverified - Updated -


Compiling rules written in mvel dialect which use binary operation taking java.math.BigDecimal type operands causes an error.
When I build a maven project which contains the following rule in executable model,

package org.example.reproducer

import org.example.reproducer.Person;

dialect "mvel"

rule "salary-increase"
        $p : Person( age >= 26 )
        System.out.println("***** Action of rule \"salary-increase\"");
        $p.salary = $p.salary + 50000;

compilation error occurs with the messages like below.

[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] /path/to/project1/target/generated-sources/drools-model-compiler/main/java/org/example/reproducer/[36,76] salary has private access in org.example.reproducer.Person
[ERROR] /path/to/project1/target/generated-sources/drools-model-compiler/main/java/org/example/reproducer/[36,101] bad operand types for binary operator '+'
  first type:  java.math.BigDecimal
  second type: int
[INFO] 2 errors

Where $p.salary is a java.math.BigDecimal type property of Person.


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

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content