Recall that the node Switch is configured so that the flow of control passes out through the second output terminal if the requested item number is not found by CheckItemAvailabililty.seqflow (see Step 4.2: Add a Switch node to the top-level flow). Now in this step you create an Assign node, connect it to the second output terminal of the node Switch, and add mappings to it to store an error code and an error message in the output parameters of CatalogOrder.seqflow.
To add the Assign node:
If CatalogOrder.seqflow is not already open in the flow editor then:
Open CatalogOrder.seqflow in the flow editor.
In the workbench's main menu click .
Add a second Assign node immediately to the right of the Switch node Switch. The new Assign node is named Assign2 (the default name).
Create a connection from the output terminal Default of the node Switch to the input terminal of the node Assign2:
Right-click the Switch node Switch.
Click Create Connection. The Terminal Selection window opens.
Complete the connection by clicking the input terminal of Assign2.
Create a connection from the output terminal of Assign2 to the input terminal of o_CatalogOrder.
The flow editor canvas for CatalogOrder.seqflow should now look something like Figure 1:
Close the flow editor.
In this subtopic you create mappings to set the return code and return the values in the output message o_CatalogOrder of the top-level flow CatalogOrder.seqflow.
To create the mappings:
If CatalogOrder.seqflow is not already open in the flow editor then:
Open CatalogOrder.seqflow in the flow editor.
In the workbench's main menu click .
Open the mapping routine for the Assign node Assign2:
Right-click the node Assign2.
Click Open Mapping Routine. The mapping editor opens and displays the mapping routine.
Add o_CatalogOrder to the mapping routine as a target message. (This message is the output data message used by the flow CatalogOrder.seqflow.)
On the mapping routine toolbar click the Add
a target message
icon. The Select Message window
opens.
The target message is added to the right side of the mapping routine area.
Create a mapping that stores the integer value 99 into the target element o_CatalogOrder.returnCode:
On the target side of the mapping routine area right-click o_CatalogOrder.returnCode.
Click Create Transform.
Click the transform Assign if it is not already selected.
Create a mapping that stores the string Item was not available in the catalog into the target element o_CatalogOrder.returnMessage:
On the target side of the mapping routine area right-click o_CatalogOrder.returnMessage.
Click Create Transform.
Click the transform Assign if it is not already selected.
Close the mapping editor.
Close the flow editor.