KJAR build fails with executable model when comparing BigDecimal type and String type property like the following.
rule "rule_compare_bd_and_str" no-loop true when $fact : Fact( $bd: bd ) $code : Code( id == $bd ) then System.out.println("***** $fact = "+$fact+", $code = "+$code); end
In Fact class, bd is BigDecimal type property.
In Code class. id is String type property.
Executable model build fails with the following error:
[ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.59.0.Final-redhat-00006:generateModel (default-generateModel) on project kjarCreation: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.59.0.Final-redhat-00006:generateModel failed: [com/example/reproducer/P22/LambdaExtractor22353C40A1384D56E5C5AEF7CBBEECB5.java (25:858) : Cannot cast from BigDecimal to String] -> [Help 1]
and here is the problematic generated source code which causes above ERROR.
@Override()
public java.lang.Object apply(java.math.BigDecimal $bd)
Non-executable model build succeeds with above rule.
In addition, executable model build also succeeds with version 7.11.1.(7.52.0.Final-redhat-00008)
- clones
-
DROOLS-6823 Exec model compilation fails when comparing BigDecimal and String
- Resolved