Rational Developer for System z

Step 4.2: Add a Switch node to the top-level flow

In this step you will add a Switch node to CatalogOrder.seqflow to test the result value returned by the recorded flow.

In Step 4.1 you copied the value in o_CheckItemAvailability.available -- the result value returned by the recorded flow iCheckItemAvailable.seqflow -- to the working variable v_CatalogOrder.available (see Add an Assign node to the top-level flow). You will now add a new Switch node to the top-level flow to test whether the result value stored in v_CatalogOrder.available is the string YES, indicating that the requested item number was found, or an empty string indicating that the requested item number was not found.

To add the Switch node and its logic:

  1. Open CatalogOrder.seqflow in the flow editor.
    1. In the EST Project Explorer right-click CatalogSample > Flows > CatalogOrder.seqflow.
    2. Click Open With > Flow Editor.

  2. In the workbench's main menu click View > Zoom Out.

  3. Add a new Switch node to the flow editor canvas and position it above and to the right of Assign. The name of the new Switch node is Switch.

  4. Create a connection from the output terminal of Assign to the input terminal of Switch (see Figure 1).
    Figure 1. Connect Assign to Switch
    Nodes CheckItemAvailability, Assign, and Switch

  5. Add logic to the new Switch node to check the value of the variable v_catalogOrder.available:

    1. Open the ESQL expression for the first (topmost) output terminal of the Switch node named Switch:

      1. Right-click the Switch node.

      2. Click Edit Expression > Expression.

        The Edit Expression window opens. The Messages in scope list and the expression input are blank.

    2. Add the variable v_CatalogOrder to the scope:

      1. Click Add. The Select Message window opens.

      2. In the Select Message window click CatalogSample > CatalogSample.Interface > Messages > v_CatalogOrder.sfmxsd > v_CatalogOrder.

      3. Click OK.

      The message v_CatalogOrder is added to the scope.
      Note: Notice that an error message appears in the upper area of the Edit Expression window:
       Encountered '<EOF>' at line 0, column 0.</EOF>
      This message simply indicates that the expression input area is currently empty.
    3. Create an ESQL expression for the Switch node:

      1. Copy the expression shown in Figure 2 into the expression input area of the Edit Expression window. You should be able to copy and paste the line from this tutorial document directly into the expression input area:

        Figure 2. ESQL expression for the Switch node named Switch
        v_CatalogOrder.available='YES'
        When the Switch node is performed at run time:
        • If the variable v_CatalogOrder.available contains the string YES then the ESQL expression is true and the flow of control goes out of the first output terminal of the Switch node.
        • Otherwise the ESQL expression is false and the flow of control goes out of the last (default) output terminal of the Switch node.

    4. Click OK.

  6. Close the flow editor.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)