When the originating Actor's output is a complex object, the iteration's complexity increases due to the object's internal hierarchy of fields and nested arrays. Thus the iteration logic over an object with multiple links is impacted by the answers to the following questions:
This article describes how Broadway performs complex iteration use cases, such as:
If the connected elements of the object are on the same level of hierarchy such as two fields of the same array, the iteration's behavior is the same as an iteration over two or more elements in a result array.
To get more information about the use cases on how to iterate over a loop with conditions and handle the Actors output correctly, refer to Iterations With Conditions article.
The originating Actor's output can have more than one collection. A common use case is a JSON data structure that contains more than one array. Occasionally there may be a requirement to manage several loops over the same data structure, for example to combine the data from two arrays or to perform other types of data manipulation. In this case, both arrays (or elements in the arrays) must be connected using an Iterate link type to one or more Actors.
The iteration logic is impacted by the answers to the question - do these arrays have the same or a different size? When the arrays have a different size, at some point one array ends and returns a null while another array still has values. To prevent the redundant loops over the empty array, split the flow and create a Stage Condition to check if the array returns a value or a null.
Another recommended way to handle two collections of different sizes is to use Inner Flows. You can pass each array by a value into its respective inner flow and then iterate within each inner flow on the array's values.
When the originating Actor's output is a complex object, the iteration's complexity increases due to the object's internal hierarchy of fields and nested arrays. Thus the iteration logic over an object with multiple links is impacted by the answers to the following questions:
This article describes how Broadway performs complex iteration use cases, such as:
If the connected elements of the object are on the same level of hierarchy such as two fields of the same array, the iteration's behavior is the same as an iteration over two or more elements in a result array.
To get more information about the use cases on how to iterate over a loop with conditions and handle the Actors output correctly, refer to Iterations With Conditions article.
The originating Actor's output can have more than one collection. A common use case is a JSON data structure that contains more than one array. Occasionally there may be a requirement to manage several loops over the same data structure, for example to combine the data from two arrays or to perform other types of data manipulation. In this case, both arrays (or elements in the arrays) must be connected using an Iterate link type to one or more Actors.
The iteration logic is impacted by the answers to the question - do these arrays have the same or a different size? When the arrays have a different size, at some point one array ends and returns a null while another array still has values. To prevent the redundant loops over the empty array, split the flow and create a Stage Condition to check if the array returns a value or a null.
Another recommended way to handle two collections of different sizes is to use Inner Flows. You can pass each array by a value into its respective inner flow and then iterate within each inner flow on the array's values.