]
Luca Molteni updated DROOLS-5959:
---------------------------------
Sprint: 2020 Week 52-03 (from Dec 21)
BigDecimal_variable % Numeric_value operation causes a compilation
error in executable model.
---------------------------------------------------------------------------------------------
Key: DROOLS-5959
URL:
https://issues.redhat.com/browse/DROOLS-5959
Project: Drools
Issue Type: Bug
Components: executable model
Reporter: Luca Molteni
Assignee: Luca Molteni
Priority: Major
Labels: support
Attachments: reproducer_mc_1b.zip
Building a rule written in MVEL dialect like (\*1) using _BigDecimal_variable_ {{%}}
_Numeric_value_ operation (\*1-1) in executable rule model, a compilation error (\*2)
occurs.
(\*1)
{noformat}
package com.example.reproducer
import com.example.reproducer.Fact
dialect "mvel"
rule "rule1b"
when
$fact : Fact( $year : year, (($year % 400) == 0) || ((($year % 4) == 0)
&& (($year % 100) != 0)), $flag : "YES" ) // ..... (*1-1)
then
modify($fact) {
leapYear = $flag
}
System.out.println("***** $fact: " + $fact + ", " + $year +
" is a leap year? " + $fact.leapYear);
end
{noformat}
(\*2)
{noformat}
[ERROR]
/work2/testdir/reproducer_mc_1b/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/PF6/LambdaPredicateF6282A65CE56BF77478DD6D1D7E1AFE4.java:[17,133]
bad operand types for binary operator '%'
first type: java.math.BigDecimal
second type: int
{noformat}