5.5.1

Table Of Contents
For example, suppose that you are about to rename a virtual machine. You need the virtual machine object
and its new name. If you have to rename multiple virtual machines, you need two arrays, one for the virtual
machines and one for their names. These two arrays are not explicitly connected. A composite type lets you
have one array where each element contains both the virtual machine and its new name. In this way, the
connection between those two parameters in case of multiple values is specified explicitly and not implied
by the workflow schema.
NOTE You cannot run a workflow that contains composite types from an Orchestrator Web view or from
the vSphere Web Client.
Define a Foreach Element
If you want to run a subworkflow multiple times by passing different values for its parameters or attributes
in every subsequent run, you can insert a Foreach element in the parent workflow.
When you insert a Foreach element, you must select at least one array over which the Foreach element
iterates. An array element can have different values for each subsequent workflow run.
If the subworkflow has output parameters, you should select the output parameters of the Foreach element
in which to accumulate workflow outputs , so that the subworkflow can iterate over them as well.
Prerequisites
Open a workflow for editing in the workflow editor.
Procedure
1 In the workflow editor, select the Schema tab.
2 From the Generic menu, drag a Foreach element in the workflow schema.
3 Select a workflow from the Chooser dialog box.
The following notification appears at the top of the schema pane.
Do you want to add the activity's parameters as input/output to the current workflow?
4 On the notification, click Setup.
A pop-up window with the available options appears.
5 Select the mapping type for each input parameter.
Option Description
Input
The argument is mapped to an input workflow parameter.
Skip
The argument is mapped to a NULL value.
Value
The argument is mapped to an attribute with a value that you can set from
the Value column.
6 Select the mapping type for each output parameter.
Option Description
Output
The argument is mapped to an output workflow parameter.
Skip
The argument is mapped to a NULL value.
Local variable
The argument is mapped to an attribute.
7 Click Promote.
8 Right-click the Foreach element and select Synchronize > Synchronize presentation.
A confirmation dialog box appears.
Chapter 1 Developing Workflows
VMware, Inc. 39