]
Luca Molteni updated DROOLS-5887:
---------------------------------
Sprint: 2020 Week 49-51 (from Nov 30)
The enhanced "for" (foreach) statement causes compilation
error in executable models.
-------------------------------------------------------------------------------------
Key: DROOLS-5887
URL:
https://issues.redhat.com/browse/DROOLS-5887
Project: Drools
Issue Type: Bug
Components: executable model
Reporter: Luca Molteni
Assignee: Luca Molteni
Priority: Major
Labels: support
Attachments: reproducer_02801729_1a.zip
Compiling a rule like (*1) which is described in MVEL dialect and contains the enhanced
"for" (foreach) statement in the action part with executable rule models
enabled, compilation error like (*2) occurs at the enhanced "for" statement.
(*1)
{noformat}
package com.example.reproducer
import java.util.ArrayList
import com.example.reproducer.Bus
dialect "mvel"
rule "bus1"
when
$buses : ArrayList() from collect ( Bus() )
then
for (Bus : $buses ) {
System.out.println("bus: " + bus);
}
end
{noformat}
(*2)
{noformat}
[ERROR] Unable to build KieBaseModel:rules
CompilationProblemErrorResult: org.drools.mvelcompiler.MvelCompilerException: Type check
of for (Bus bus : $buses) {
System.out.println("bus: " + bus);
} failed.
{noformat}