]
Matteo Mortari closed DROOLS-1245.
----------------------------------
Fix Version/s: 6.5.0.Final
7.0.0.Final
Resolution: Done
Fixed by
Document limitation of (legacy) Accumulate CE Alternate Syntax:
single function with return type
------------------------------------------------------------------------------------------------
Key: DROOLS-1245
URL:
https://issues.jboss.org/browse/DROOLS-1245
Project: Drools
Issue Type: Enhancement
Components: docs
Affects Versions: 6.4.0.Final
Reporter: Matteo Mortari
Assignee: Matteo Mortari
Fix For: 6.5.0.Final, 7.0.0.Final
Document limitations and common pitfalls:
h2. from+accumulate does not iterate
This does NOT iterate over the elements of the accumulate function:
{code:java}
rule R when
$theFrom : Object() from accumulate(MyPerson( $val : name );
collectList( $val ) )
then
list.add($theFrom);
end
{code}
and in fact the binded $theFrom : Object() is the List returned by the collect list.
While normally the "from" iterates over the element of list/iterable
collections.
{code:java}
rule R1 when
$list : List( )
$s : Integer() from $list
then
out.add($s);
end
{code}