In RHDM 7 Executable model compiler casting int to short causes compilation error when variable is inside the bracket.
Issue
-
In RHDM 7 Executable model compiler casting int to short causes compilation error when variable is inside the bracket.
- Rule look like as:
rule "test_rule" dialect "java" when $integerToShort : IntegerToShort( $testInt : testInt , testBoolean!=null, testBoolean==false) then System.out.println("rule_a fired "); $integerToShort.setTestShort((short)($testInt)); $integerToShort.setTestBoolean(true); update($integerToShort); end
- Exception while compiling:
Begin Compiling intToShort................. Compilation eroor received during compilation of intToShort [Message [id=1, level=ERROR, path=src/main/java/com/rules/test/P44/LambdaConsequence44829DEB6B40DD084A41380571DC2A07.java, line=19, column=50 text=incompatible types: java.lang.Integer cannot be converted to short], Message [id=2, level=ERROR, path=src/main/java/com/rules/test/P44 /LambdaConsequence44829DEB6B40DD084A41380571DC2A07.java, line=0, column=0
Environment
- Red Hat Decision Manager
- 7.8.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.