]
Luca Molteni resolved DROOLS-5899.
----------------------------------
Resolution: Fixed
Expression like BigDecimal_type_property =
BigDecimal_type_property.divide(BigDecimal_value) causes a build failure in executable
model.
----------------------------------------------------------------------------------------------------------------------------------------
Key: DROOLS-5899
URL:
https://issues.redhat.com/browse/DROOLS-5899
Project: Drools
Issue Type: Bug
Components: executable model
Reporter: Luca Molteni
Assignee: Luca Molteni
Priority: Major
Labels: support
Compiling a rule like (*1) which is described in MVEL dialect and uses an expression like
_BigDecimal_type_property_ = _BigDecimal_type_property_.divide(_BigDecimal_value_), for
example (*1-1), with executable rule models enabled, an error like (*2) occurs.
This issue occurs in the case of using the other basic operation add, subtract and
multiply as well as divide.
(*1)
{noformat}
package com.example.reproducer
import com.example.reproducer.Bus
import java.math.BigDecimal
dialect "mvel"
rule "bus3d"
when
$bus : Bus()
then
$bus.weight = $bus.weight.divide(BigDecimal.valueOf(1000)); ..... (*1-1)
System.out.println("***** " + $bus + ", weight = " +
$bus.weight);
end
{noformat}
$bus.weight is a BigDecimal type property.
(*2)
{noformat}
[ERROR] Unable to build KieBaseModel:rules
CompilationProblemErrorResult: org.drools.mvelcompiler.MvelCompilerException: RHS
doesn't have a type
{noformat}