Hi,
I’m trying to iterate over a collection with a multi instance loop, but I fail at setting a correct variable that has the type Collection
. Executing my BPMN workflow results in an error message: Variable 'articlePackages' is not from type 'Collection'
.
The variable I pass to the putExecutionVariable()
function is an instance of a custom collection class which is written in PHP and looks like this:
class TestCollection implements \IteratorAggregate, \Countable
{
private $test;
public function __construct()
{
$this->test = ['a', 'b', 'c'];
}
public function getIterator()
{
return new \ArrayIterator($this->test);
}
public function count()
{
return count($this->test);
}
}
But passing a variable having the type TestCollection
doesn’t work for the engine. Unlike in Java, there is no Collection
base class that I can inherit from.
So how do I pass a Collection
variable to the execution in PHP?
Thanks for your advices.