Overview
ArrayIterator
ArrayIterator encapsulates the PAS Builder's expansion region, and is specifically intended to be used in Designer models in the event that you need to trace a model that iterates over (large) arrays. The "foreach" primitive available in Designer creates very huge trace files in these events which often cannot be loaded into the Analyzer.
Usage
In order to use it, you
-
create a class inheriting from ArrayIterator,
-
override inoutIterationItem and/or inIterationItem, and
-
delegate this call to an operation with typed input (and output). See example below.
Inheritance Example
In this example, ArticleListIterator inherits from ArrayIterator, and overrides inoutIterationItem. Note that this operation needs to be non-static. In the execution diagram you can see how the iterator is first created and then used as target for the inoutIteration operation, which is taken from the ArrayIterator base class, and fed with in and out array connectors.
Inner Any Operation Example
The ArrayIterator's inoutIteration will call the inherited and overridden inoutIterationItem operation on each array item, but with types Any. You should define another operation with typed in an out pins and call this instead.
Inner Typed Operation Example
If you do so, you can still have the mapping diagram show the mapping, alter it at any time, whenever one of the in or out type definition changes.