Details
-
Bug
-
Resolution: Done
-
Major
-
7.10.1.GA
-
None
-
Red Hat Decision Manager 7.10.1
-
False
-
False
-
CR1
-
+
-
Undefined
-
-
2021 Week 19-21 (from May 10), 2021 Week 22-24 (from May 31)
Description
Compile fails with the error in executable model when setting BigDecimal type variable to String type property in RHS.
Here is example of rules.
Example Rule 1
rule "rule cannot find symbol 2" when $fact : Fact( $bd: bd ) then $fact.text = $bd; System.out.println("***** $fact.text = "+$fact.text); end
Compilation error :
[ERROR] /path/to/reproducer_set_bigdecimal_to_string/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/PDB/LambdaConsequenceDB86D1D027F981C570371BD3694D10F6.java:[25,14] cannot find symbol [ERROR] symbol: variable text [ERROR] location: variable $fact of type com.example.reproducer.Fact
In this example, problematic property 'text' is not real property name, but only setter/getter are defined like the following.
public String getText() { return getStr(); } public void setText(String str) { setStr(str); }
Example Rule 2
rule "rule_set_bd_to_str" no-loop true when $fact : Fact( $bd: bd ) then $fact.str = $bd; System.out.println("***** $fact.str = "+$fact.str); end
Compilation error :
[ERROR] /path/to/reproducer_set_bigdecimal_to_string/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/PFC/LambdaConsequenceFC4DFA1CB831E1940CE9B37A0C925678.java:[25,14] str has private access in com.example.reproducer.Fact [ERROR] /path/to/reproducer_set_bigdecimal_to_string/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/PFC/LambdaConsequenceFC4DFA1CB831E1940CE9B37A0C925678.java:[25,21] incompatible types: java.math.BigDecimal cannot be converted to java.lang.String
Attachments
Issue Links
- is cloned by
-
DROOLS-6361 compile error in exec model when setting BigDecimal variable to String type property
- Closed