Rational Developer for System z, Version 7.6

Steps for recording a loop

This topic describes the steps for recording a repeating sequence of application screens as a loop.
This topic contains the following subtopics:

For an example of recording a loop see the tutorial topic Step 2.4: Record the flow.

Preparation for recording a loop

To prepare for recording a loop:

  1. Determine which of the application screens in the repeated sequence you want to use with each of the loop controls: Begin Loop, End Loop, Exit Loop, and the Exit Flow Loop window (see Controls for recording a loop).

  2. Create a screen description for each of these application screens.

    Typically you create each screen description as follows:
    1. Generate a screen description either by capturing an application screen or by importing a BMS screen.
    2. Refine the screen description so that it matches only the correct application screen.

    See the example of preparing for recording a loop in the first tutorial (see A. Prepare for the flow recording).

  3. Test the screen description for each of the loop controls. For each screen description, navigate through the terminal application and verify that:
    • The screen description is the recognized screen description when the application screen that you want to use with the loop control is displayed; and
    • The screen description is not the recognized screen description when an application screen that you want to use with one of the other loop controls is displayed.
      Note: The structure of the loop can require that the same screen description is used with more than one loop control. For example, in the second tutorial the same screen description is used with Begin Loop and End Loop (see Step 2.4: Record the flow).

Recording the loop

The following sequence of steps assumes that flow recording is already in progress. To record a repeating sequence of screens as a loop:

  1. Navigate to the application screen that you want to use with Begin Loop (see Controls for recording a loop):
    • This application screen is the first application screen of the first iteration of the loop.
    • Verify that the recognized screen description is the one that you want to use with Begin Loop.
  2. On the toolbar of the host editor click Begin Loop Begin Loop (see Controls for recording a loop).
    Note: The Begin Loop Begin Loop icon is replaced with the End Loop icon End Loop to indicate that a loop is being recorded and that you now need to navigate to the application screen that you want to use with the End Loop control. (See Step 3.)
    1. If you have not selected a variable message file and a variable message for the current flow then the host editor opens the No Variable Message File window and prompts you to select or create a message file and a message for the flow (see Specifying a variable message later on during flow recording). Make your selections and click OK.

    2. The Select Variable window opens.
      Tip: The window does not open if you have selected the check box Do not prompt for variables when generating variable mappings in the Service Flow Project preferences (see Setting overall preferences for service flow projects). The loop variable is created automatically.
      The Select Variable window displays a list of all the variables in the variable message of the current flow (the flow being recorded) that can be used as a loop variable. To be used as a loop variable a variable must be a String variable.
      Note: The list also includes any String variable that you have used previously in the current flow as an Insert variable, a simple Extract variable, or a loop variable.
      1. From the list of variables displayed in the window select the variable that you want to use as the loop variable.

        You can create a new variable by clicking Add new variable and typing a variable name. The window creates a new String variable and adds it to the list of available variables.

      2. Click OK.

    At runtime the value stored in the loop variable indicates to the While node of the loop whether to perform another iteration of the loop or to stop looping (see Recorded loop: Non-iterative case).

  3. Navigate completely through one iteration of the loop that you are recording until you again arrive at the Begin Loop application screen.

  4. On the toolbar of the host editor click End Loop End Loop (see Controls for recording a loop).

    The host editor makes two changes in the toolbar:

    • It replaces the End Loop icon End Loop with the Exit Loop icon Exit Loop to remind you that you have reached the stage in loop recording in which you are seeking for the Exit Loop application screen.

    • It disables the Stop Flow Recording icon Stop Flow Recording to remind you that flow recording is temporarily suspended until you identify the Exit Loop screen.

      Why flow recording is suspended: The reason for temporarily suspending flow recording is so that the host editor does not record any application screens between the End Loop application screen and the Exit Loop application screen. It is not necessary to record these intervening application screens because the application screens in the loop that you are recording handles them.

  5. Navigate through the application until you arrive at the first application screen that the user encounters when the loop terminates. This screen is Exit Loop application screen.

  6. Click the Exit Loop Exit Loop (see Controls for recording a loop).

    The Exit Flow Loop window opens.

  7. In the Exit Flow Loop window:

    1. In the upper pane of the Exit Flow Loop window select the check box beside any listed application screen that you want to identify as a valid exit point from the recorded loop.

      The upper pane of the window lists the screen descriptions of all the exit-from screens in the recorded loop. An exit-from screen is an application screen inside a loop from which navigation can flow to the Exit Loop screen in one step (see Exit-from screens). Depending on the structure of the terminal application the list can contain a single exit-from screen or several.

      Selecting an exit-from screen in this list causes the recorded loop to terminate when navigation goes from the selected exit-from screen to the Exit Loop screen in one step. The recorded loop does not terminate until navigation passes from a selected exit-from screen to the Exit Loop screen in one step (see Exit-from screens).

      As a visual aid the lower pane of the window shows a thumbnail image of the currently selected exit-from screen, followed by thumbnails of the application screens in the loop to which navigation can flow in one step from the selected screen. If the check box beside the selected exit-from screen is selected then a thumbnail of the Exit Flow screen is added to the thumbnails following the selected screen.

    2. Click OK.

  8. The loop recording is complete. The host editor performs the following actions:

    1. It creates new flow nodes and other artifacts and stores into them a complete description of the recorded loop (see Recorded loop: Non-iterative case).

    2. It disables the Exit Loop icon Exit Loop to show that the loop recording is complete.

    3. It enables the Stop Flow Recording icon Stop Flow Recording to indicate that flow recording is reenabled.

  9. Flow recording resumes starting with the currently displayed application screen, which is the Exit Loop screen.

Including text from an Extract action for the Exit Loop screen

When you select the check box Extract data every iteration of the loop for an Extract action in a recorded loop and specify a variable (for example, a variable named PartNumbers) in the usual way, then optionally for the Exit Loop screen of the same loop you can create an Extract action that stores text into the final available instance of the same variable (PartNumbers), as if the Exit Loop screen was an additional iteration of the loop.

This feature is useful when you are recording a loop that extracts text from the screens of a multipage list and the application screen that you want to use as the Exit Loop screen also displays the last page of data from the list.

To use this feature:

  1. Begin recording the loop in the usual way.

  2. Continue recording the loop in the normal way. After you have finished recording the loop (that is, after the Exit Flow Loop window closes) the Exit Loop application screen is still displayed.

  3. Create an Extract action for the Exit Loop screen and set the following options:
    1. Select the same Extract variable that you selected in Step 2 above.
    2. Select the check box Extract data every iteration of the loop as you did in Step 2 above.
      Note: The Maximum number of iterations field is disabled and contains the same value that you set for the Extract action in the Begin Loop screen.
    3. For the remaining Extract options, select the same Extract options that you selected in the Extract action for the Begin Loop screen.
    4. Click OK.
Note:
  • Make sure that the maximum number of iterations of the variable is large enough to include the text from the Extract action for the Exit Loop screen. At runtime if all the instances of the variable are full then the Extract action for the Exit Loop screen is not performed.
  • If you create an Extract action for the Exit Loop screen and you do not want to add the text to the same variable that you store text into during the loop, then do not select the check box Extract data every iteration of the loop and do not select the same variable.


Terms of use | Feedback

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