Rational Developer for System z, Version 7.6

Overview of the logic of the service flow

The completed service flow simulates an ordering system that checks for the availability of a requested item and then places an order for the item if it is available.

This topic and its subtopics are provided for completeness. You do not have to read this topic to perform the steps in the tutorial. However, you might want to refer to this topic from time to time, to review how the step you are working on fits in with the whole.

Top-level flow

Figure 1 shows the top-level flow:
Figure 1. Contents of the top-level flow
CatalogOrder.seqflow with the Assign1 node added
When the top-level flow is invoked:
  1. The node variableAssignInput gets the two input parameters provided by the caller: an item number and an item quantity.
  2. The next node CheckItemAvailability invokes a recorded flow to determine whether the item having the specified item number is available.
  3. A Switch node tests the return code provided by the recorded flow:
    1. If the item is available then the upper path of control is taken:
      1. The node PlaceOrder invokes a nonterminal application to place the order.
      2. The node variableAssignOuput sets up a return value and a return message from the flow indicating that the request was performed successfully.
    2. If the item is not available then the lower path of control is taken:
      1. The node Assign2 sets up a return value and a return message from the flow indicating that the request failed.

Recorded flow

The recorded flow launches a terminal application and scans the screens of a catalog looking for the requested item number. Figure 2 shows the recorded flow:
Figure 2. Contents of the recorded flow
Contents of CheckItemAvailability.seqflow
When the recorded flow is invoked:
  1. The Assign node variableAssignInput gets the input parameter, which is an item number.
  2. The node Dfh0xs1Exmenu_Exmenu simulates user input to request the terminal application to display a catalog of items.
  3. The init node init_variable0 initializes the loop variable for the While node.
  4. The While node while_variable0 repetitively invokes its associated flow, which scans one screen of the catalog for the specified item number. The loop terminates if the specified item number is found or when all the screens of the catalog have been scanned.
  5. A Switch node tests the return code from the invoked flow.
    • If the item is found then the upper path of control is taken:
      1. A return code for the flow is set indicating that the item was found.
      2. The node dfh0xs2.Exinqc_EndPage simulates user input to navigate beyond the last screen of the catalog.
    • If the item is not found then the lower path of control is taken:
      1. A return code for the flow is set indicating that the item was not found.

Flow invoked by the While node

The flow invoked by the While node searches one screen of the catalog for the specified item number and then returns to the While node. Figure 3 shows the invoked flow.
Figure 3. Contents of the flow invoked by the While node
Contents of the interior of the While loop
When the invoked flow is invoked by the While node:
  1. Mappings in the output terminal of the node Dfh0xs2.Exinqc_ExinqcInitialExtract copy the item numbers from the currently displayed screen of the catalog and store the item numbers into variables.
  2. The Switch node contains an ESQL expression testing whether any of the item numbers just read are the requested item number:
    • If the item number is found then the upper path of control is taken:
      1. The node Assign sets a global variable indicating that the requested item number is found. The node then sets the loop variable so that the While node terminates the loop at the next opportunity.
    • If the item is not found then the lower path of control is taken:
      1. Mappings in the input terminal of the node Dfh0xs2.Exinqc_Exinqc generate user input to navigate forward to the next screen of the catalog:
        • If the new screen is the Exit Loop screen -- the first screen that occurs after the last screen of the catalog -- then the upper path of control is taken:
          1. The node loopEnd_variable0 sets the loop control variable to terminate the While loop.
        • Otherwise the lower path of control is taken. The loop variable is not modified, so the While node continues to invoke this flow.


Terms of use | Feedback

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