Mario Fusco created DROOLS-5938:
-----------------------------------
Summary: In accumulate implemention of executable model field binding
overtake pattern binding even when not appropiate
Key: DROOLS-5938
URL:
https://issues.redhat.com/browse/DROOLS-5938
Project: Drools
Issue Type: Bug
Components: executable model
Reporter: Mario Fusco
Assignee: Mario Fusco
When translated into the executable model the following rule works correctly
{code:java}
global java.util.List result;
rule R when
$acc1 : Collection() from accumulate(
$p : Person( ), collectSet( $p ) )
then
result.add($acc1.iterator().next());
end{code}
but if a field binding is added to the accumulated pattern like in
{code:java}
global java.util.List result;
rule R when
$acc1 : Collection() from accumulate(
$p : Person( $name : name ), collectSet( $p ) )
then
result.add($acc1.iterator().next());
end {code}
then the accumulation is wrongly performed on the bound field, the person's name in
this case, instead of on the Person object itself as specified in the accumulating
function.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)