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 described 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 behavior is the same as the iteration over two or more elements in a result array as described in the previous 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 it may be required to manage several loops over the same data structure, for example in order to combine the data from two arrays or to perform other kind of data manipulation. In this case, both arrays (or elements in the arrays) need to be connected using an Iterate link type to one or more Actors.
In this case the iteration logic is impacted by the answers to the question - do these arrays have the same or different size? When the arrays have different size, at some point one of them is finished and returns a null while the another one still has values. To prevent the redundant loops over the empty array, use the IsNull Actor to check if the array returns a value or null.
Another recommended way to handle two collections with different sizes is by using the Inner Flows. You can pass each array by value into its respective inner flow and then iterate inside each inner flow on the array 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 described 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 behavior is the same as the iteration over two or more elements in a result array as described in the previous 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 it may be required to manage several loops over the same data structure, for example in order to combine the data from two arrays or to perform other kind of data manipulation. In this case, both arrays (or elements in the arrays) need to be connected using an Iterate link type to one or more Actors.
In this case the iteration logic is impacted by the answers to the question - do these arrays have the same or different size? When the arrays have different size, at some point one of them is finished and returns a null while the another one still has values. To prevent the redundant loops over the empty array, use the IsNull Actor to check if the array returns a value or null.
Another recommended way to handle two collections with different sizes is by using the Inner Flows. You can pass each array by value into its respective inner flow and then iterate inside each inner flow on the array values.