Use the ForEach Connection Code Block
The ForEach Connection code block offers a similar family of iterations tailored to navigate through the model connections.
Example: ForEach Connection
In this example, we have created a simple analytic that enumerates the input and output connections of a process unit. For the purpose of the example, we have selected only the p_CU process unit.
| ForEach Connection Code Block | Code Transcription |
|---|---|
![]() |
info
The inner code blocks of the ForEach Connection are subjected to the element context switch, from the parent element to the connected element, based on the input and output ports.
The results look like this:
ForEach Connection results
You can easily navigate through the connection chains, isolating the ForEach Connection in a recursive Function like we did previously, to navigate parent -- children elements.
