The error message is not very helpful but the stack trace is. This line is important:
at org.drools.model.codegen.execmodel.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:132)
In debug mode and a break point on this line, it can be observed that the patternSource is actually a FromDesr, and not an AccumulateDescr as expected. The empty init() and action() statements are incompliant with the fromAccumulate parser rule and so the parser is forced to recognize this accumulate statement using fromExpression.
Parent issue
5678
Failing tests
org.drools.compiler.integrationtests.AccumulateTest#testAccumulateReturningNull
Notes
The error message is not very helpful but the stack trace is. This line is important:
In debug mode and a break point on this line, it can be observed that the
patternSource
is actually aFromDesr
, and not anAccumulateDescr
as expected. The emptyinit()
andaction()
statements are incompliant with thefromAccumulate
parser rule and so the parser is forced to recognize this accumulate statement usingfromExpression
.Rule code snippet
Error output