-
Bug
-
Resolution: Done
-
Major
-
7.52.0.Final, 7.56.0.Final
-
2021 Week 25-27 (from Jun 21)
-
2
-
-
-
Undefined
-
NEW
-
NEW
When bind variable produced by accumulate is used in the condition of subsequent accumulate like the following,
accumulate( Fact(id == $id, $str1 : str1); $count : count($str1), $maxStr1 : max($str1); $count > 1 ) accumulate( Fact(id == $id, str1 == $maxStr1, $str2 : str2); $maxStr2 : max($str2) )
compilation fails with the error like the following (the error is a bit different per version).
//7.52.1-SNAPSHOT
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile-1) on project reproducer_accumulate_bind_variables: Compilation failure: Compilation failure: [ERROR] /home/Case/02972411/work/reproducer_accumulate_bind_variables/kjarCreation/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/Rules7f7bf65f8c4b470085e07368517e472dRuleMethods0.java:[76,164] cannot find symbol [ERROR] symbol: variable var_$maxStr1_2_sCoPe [ERROR] location: class com.example.reproducer.Rules7f7bf65f8c4b470085e07368517e472dRuleMethods0 [ERROR] /home/Case/02972411/work/reproducer_accumulate_bind_variables/kjarCreation/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/Rules7f7bf65f8c4b470085e07368517e472dRuleMethods0.java:[157,163] cannot find symbol [ERROR] symbol: variable var_$maxBd1_2_sCoPe [ERROR] location: class com.example.reproducer.Rules7f7bf65f8c4b470085e07368517e472dRuleMethods0 [ERROR] -> [Help 1]
//7.56.0-SNAPSHOT
[ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.56.0-SNAPSHOT:generateModel (default-generateModel) on project reproducer_accumulate_bind_variables: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.56.0-SNAPSHOT:generateModel failed: [com/example/reproducer/Rules48f1460cfa884208bf0c1de4da5b3de6RuleMethods0.java (76:10411) : var_$maxStr1_2_sCoPe cannot be resolved to a variable, com/example/reproducer/Rules48f1460cfa884208bf0c1de4da5b3de6RuleMethods0.java (157:23528) : var_$maxBd1_2_sCoPe cannot be resolved to a variable] -> [Help 1]
Build works with -DgenerateModel=NO.
- is cloned by
-
RHDM-1772 exec-model : compilation error when bind var produced by accumulate is used in the condition of subsequent accumulate
- Closed
- is duplicated by
-
DROOLS-6428 var_xxx_sCoPe cannot be resolved to a variable in accumulate with exec-model
- Closed
-
DROOLS-6466 Collecting from an accumulate result does not compile in executable model
- Closed
- is related to
-
DROOLS-6474 Revisit RuleContext.definedVars and coercion test
- Closed