In this subtopic you will convert the plain Invoke node Step0 in the top-level flow to an Invoke flow node that invokes the recorded flow CheckItemAvailability.seqflow.
Recall that you created the Invoke nodes Step0 and Step1 as place holders (see Position the nodes, add Assign nodes and Invoke nodes, and connect the nodes).
A plain Invoke node such as Step0 can be made functional by associating with it an operation or a flow. In this subtopic you will associate the flow CheckItemAvailability.seqflow with Step0 so that Step0 is converted to an Invoke flow node that invokes the recorded flow CheckItemAvailability.seqflow.
To convert Step0 to an Invoke flow node that invokes the recorded flow:
In the workbench's main menu click .
Right-click Step0.
Click Select Subflow. The Select Flow window opens.
In the Select Flow window:
Click .
Click OK.
Step0 is converted to an Invoke flow node and is given the name of the flow that it invokes, CheckItemAvailability.
Save your work (Ctrl-S).
Do not close the flow editor yet. You will need it for the next subtopic.
In this subtopic you will add three mappings to the mapping routine for the Assign node VariableAssignInput. All three mappings copy data from input parameters stored in the input message i_CatalogOrder of the top-level flow (see Table 1). The values are set by the application that calls the service flow.
| Source variable of the mapping: | Target variable of the mapping: | Type of mapping: | ||
|---|---|---|---|---|
| Name: | Data type: | Name: | Data type: | |
| i_CatalogOrder.itemNumber | xsd:short | i_CheckItemAvailability.itemNumber | xsd:string | Cast |
| i_CatalogOrder.itemNumber | xsd:short | v_CatalogOrder.itemNumber | xsd:short | Move |
| i_CatalogOrder.itemQuantity | xsd:short | v_CatalogOrder.itemQuantity | xsd:short | Move |
The first mapping copies the first input parameter passed to CatalogOrder.seqflow -- the item number that the calling program is searching for -- into the input message for the invoked flow CheckItemAvailability.seqflow.
To create the first mapping:
Open the mapping routine of the Assign node variableAssignInput in the mapping editor.
Right-click the Assign node variableAssignInput.
Click Open Mapping Routine. The mapping editor opens the mapping file for the flow and displays the empty mapping routine for the Assign node.
Add i_CatalogOrder to the mapping routine as a source message:
On the mapping routine toolbar click the Add
a source message
icon. The Select Message window
opens.
Click .
Click OK.
The source message is added to the left side of the mapping routine area.
Add i_CheckItemAvailability to the mapping routine as a target message:
On the mapping routine toolbar click the Add
a target message
icon. The Select Message window
opens.
Click .
Click OK.
The target message is added to the right side of the mapping routine area.
Create a mapping that copies the contents of i_CatalogOrder.itemNumber to i_CheckItemAvailability.itemNumber:
Drag i_CatalogOrder.itemNumber on the left side of the mapping routine area to i_CheckItemAvailability.itemNumber on the right side.
Save your work (Ctrl-S).
The second and third mappings to be added to this mapping routine copy the two input parameters -- itemNumber and itemQuantity -- from the i_CatalogOrder input message to the v_CatalogOrder variable message. To create the second and third mappings:
Add v_CatalogOrder to the mapping routine as a target message:
On the mapping routine toolbar click the Add a target message
icon. The Select Message window
opens.
Click .
Click OK.
The target message is added to the right side of the mapping routine area.
Create a mapping that copies the contents of i_CatalogOrder.itemNumber to v_CatalogOrder.itemNumber:
Drag i_CatalogOrder.itemNumber on the left side of the mapping routine to v_CatalogOrder.itemNumber on the right side.
The mapping editor displays a new Move transform in the center of the mapping routine area between the two message elements with a connection to each message element.
Create a mapping that copies the contents of i_CatalogOrder.itemQuantity to v_CatalogOrder.itemQuantity:
Drag i_CatalogOrder.itemQuantity on the left side of the mapping routine to v_CatalogOrder.itemQuantity on the right side.
The mapping editor displays a new Move transform in the center of the mapping routine area between the two message elements with a connection to each message element.
Close the mapping editor.
In this subtopic you will add a new Assign node named Assign to the flow v_CatalogOrder.seqflow immediately after the Invoke flow node CheckItemAvailability and you will add a mapping to the mapping routine of this new Assign node.
To create the Assign node and the mapping:
Open the flow CatalogOrder.seqflow in the flow editor if it is not already open.
In the workbench's main menu, click .
Arrange the nodes to leave space for the remaining work that needs to be done in Part 4:
In the workbench's main menu, click .
Arrange the nodes in a layout like Figure 1.

Add a new Assign node named Assign to the flow immediately after the Invoke flow node CheckItemAvailability:
Delete the connection between the node CheckItemAvailability and the node Step1.
Add a new Assign node to the flow editor canvas and position it immediately to the right of the node CheckItemAvailability. The name of the new Assign node is the default name Assign.
Create a connection from the output terminal of CheckItemAvailability to the input terminal of Assign (see Figure 2).

| Source variable of the mapping: | Target variable of the mapping: | Type of mapping: | ||
|---|---|---|---|---|
| Name: | Data type: | Name: | Data type: | |
| o_CheckItemAvailability.available | xsd:string | v_CatalogOrder.available | xsd:string | Move |
On the mapping routine toolbar, click the Add
a source message
icon. The Select Message window
opens.
Click .
Click OK.
The source message is added to the left side of the mapping routine area.
On the mapping routine toolbar, click the Add
a target message
icon. The Select Message window
opens.
Click OK.
The target message is added to the right side of the mapping routine area.
The mapping editor displays a new Move transform in the center of the mapping routine area between the two message elements with a connection to each message element.
Close the mapping editor.
Close the flow editor.