]
Mario Fusco moved RHDM-1587 to DROOLS-5965:
-------------------------------------------
Component/s: executable model
(was: BRE)
Docs QE Status: NEW
Key: DROOLS-5965 (was: RHDM-1587)
QE Status: NEW
Affects Version/s: (was: 7.1.0.GA)
(was: 7.9.0.GA)
Workflow: GIT Pull Request workflow (was: CDW with docs v1)
Environment: (was: This issue occurs on releases from RHDM 7.1.0 to 7.9.1.)
Project: Drools (was: Red Hat Decision Manager)
"and exists" used in source-pattern part of accumulate
statement matches multiple times in executable model.
------------------------------------------------------------------------------------------------------------
Key: DROOLS-5965
URL:
https://issues.redhat.com/browse/DROOLS-5965
Project: Drools
Issue Type: Bug
Components: executable model
Reporter: Mario Fusco
Assignee: Mario Fusco
Priority: Major
Labels: support
Attachments: reproducer_model_compiler_16a.zip
When executing a rule like (\*1) that uses {{and exists}} in _source-pattern_ part of
{{accumulate}} statement like (\*1-1) in executable model, the sub-pattern given by {{and
exists}} matches multiple times. For example in rule (\*1), we insert 1 {{Car}} object and
3 {{InspectionResult}} objects with the same value of {{number}} property as the {{Car}}
object, the _source-pattern_ in the {{accumulate}} statement matches 3 times. In this
case, it should match only once.
(\*1)
{noformat}
package com.example.reproducer
import java.util.List
dialect "java"
rule "rule16a2"
when
$list : List() from accumulate ( $car : Car( $number : number )
and exists InspectionResult( number == $number
); // ..... (*1-1)
collectList($car) )
then
System.out.println("***** Action of rule16a2 -- $list = " + $list);
end
{noformat}