Rational Developer for System z

Steps for creating an Extract action

This topic describes the steps for creating an Extract action during a flow recording using the Select Variable window.

To create an Extract action:

  1. Navigate to the application screen where you want to create an Extract action.

  2. On the toolbar of the host editor click Extract Data from Screen Extract. (Alternatively you can click the drop-down arrow and then click Create a Single Extract Action.)

  3. If you have not yet selected a variable message file and a variable message for the flow that you are recording, 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.

  4. The Select Variable window opens. This window has an upper pane and a lower pane:
    • In the upper pane you select an appropriately configured variable to contain the text from the Extract action.
    • In the lower pane you select options for reading, partitioning, and storing the text from the Extract action.
    Note: 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 variable is created automatically and you can select a field for the Extract action.

    Exception: However, the window does open if you are recording a loop and previously in the loop you created an Extract action in which you selected the check box Extract data every iteration of the loop.
    1. From the list of variables displayed in the upper pane of the window select the variable that you want to use with the Extract action (see The list of available variables):

      Attention: You can automatically obtain a variable having the correct characteristics for the Extract action or you can manually select a variable:

      The characteristics of the selected variable (type of variable, cardinality, and maximum number of iterations) must match the storage requirements of the Extract options that you specify in the lower pane of the window (see steps (b) and (c) below and the subtopic The characteristics of the variable must match the Extract options).

      To select a variable for the Extract action you can use the automatic configuration method or you can select an existing variable having the proper characteristics:

      • Using automatic configuration:
        1. In the list of variables select a simple variable. (A simple variable has a value of 1 in the Cardinality column -- see Type of variable.) You can either:
          • Select an existing simple variable; or
          • Create a new simple variable and select it:
            1. Click Create new variable and create a new simple variable (see Creating a new variable for the list).
            2. The variable is added to the list.
            3. Select the new variable.
        2. You can now specify the Extract options that you want to use in the lower pane of the window.
        3. When you click OK to create the new Extract action the Select Variable window automatically configures the selected variable with the characteristics required by the specified Extract options (see Automatic configuration of the selected variable). (Do not click OK yet.)

      • Manually selecting an existing variable with the proper characteristics:
        1. In the list of variables select a variable having the proper variable type, cardinality value, and maximum number of iterations value for the Extract options that you want to use (see The list of available variables):
          • Type of variable: Simple variable or array variable (see Type of variable).

          • Cardinality: If you want to read rows of text from a rectangular area of the application screen and store the rows into an array, with one row of text in each element of the array, then the cardinality of the variable must exactly match the number of rows of text in the rectangular area (see Cardinality).

          • Maximum number of iterations: If the Extract action is in a loop being recorded and you want to store the text from the Extract action into a separate instance of the Extract variable in each iteration of the loop, then the maximum number of iterations value must be exactly equal to the value in the Maximum iterations field, which specifies the maximum number of iterations that the loop is allowed to perform at runtime (see Maximum number of iterations).

        2. When you click OK the Select Variable window creates the Extract action using the selected variable. (Do not click OK yet.)

    2. If you are currently recording a loop then the following two options are also displayed:
      1. Use the check box Extract data every iteration of the loop to indicate whether you want the Extract action to store the extracted text into the same instance or into a separate instance of the selected variable in each iteration of the loop:
        • Clear the check box if you want the Extract action to store the text into the same instance of the selected variable in each iteration of the loop, overwriting the text from the same Extract action in the previous iteration of the loop.
        • Select the check box if you want the Extract action to store the text into a separate instance of the selected variable in each iteration of the loop.
        (See Extract data every iteration of the loop.)
        Iterative data and non-iterative data:
        • Iterative data refers to text extracted by an Extract action that is stored into a separate instance of the Extract variable in each iteration of the loop (see Data structure of Extract variables: Iterative case).
        • Non-iterative data refers to any text extracted by an Extract action that is not iterative data, including:
          • Text extracted by an Extract action in a loop that is stored into the same instance of the variable in each iteration of a loop.
          • Text extracted by an Extract action that is not in a loop.
          (See Data structure of Extract variables: Non-iterative case.)
      2. The Maximum number of iterations field specifies the maximum number of iterations that the loop currently being recorded is allowed to run at runtime (see Maximum number of iterations).

        The value in this field is significant for all Extract actions within the loop currently being recorded that have the check box Extract data every iteration of the loop selected:
        • In the first such Extract action you must type a value into the Maximum number of iterations field.
        • In subsequent Extract actions in the same loop in which you select the check box Extract data every iteration of the loop the Maximum number of iterations field is no longer updatable and displays the value that you typed for the first such Extract action in the loop. The same is true of Extract actions in the Exit Loop application screen following the loop.
        (See Maximum number of iterations.)
    3. Use the Extract area into variable check box to indicate whether you want the Extract action to read text from a field or from a rectangular area of the current application screen (see Reading text from a field or from a rectangular area):
      • Clear the check box if you want the Extract action to read text from a field.
        1. Select the field after the Select Variable window closes (see Step 5).
      • Select the check box if you want the Extract action to read text from a rectangular area.
        1. Use the fields in the Select Dimensions group of the Select Variable window to specify the row and column locations of the upper left and lower right corners of the rectangle (see Step 5).
    4. Click OK. The Select Variable window closes.

  5. In the session area, select the field for the Extract action, or view the highlighted rectangular area:
    • Extracting text from a field:

      If you are extracting text from a field, select the field that you want to use with the Extract action:
      1. As you move the mouse pointer icon in the session area each field that the icon passes over is highlighted with red square brackets (see Figure 1).
      2. Click the field from which you want the text to be extracted.
      Figure 1. Highlighting a field for an Extract action
      Extract from a single field
    • Extracting text from a rectangular area:

      If you are extracting text from a rectangular area then you have already specified the coordinates of the rectangular area in the Select Variable window. Now in the session area the rectangular area that you selected is highlighted with one or more red rectangles:

      • If you selected to have the text copied into a single variable then the rectangular area is highlighted with a single red rectangle:

        Figure 2. Highlighting a rectangular area to be extracted into a single variable
        Highlighting for single variable

      • If you selected to have the text copied into an array variable then each row of the rectangular area is highlighted with a red rectangle:

        Figure 3. Highlighting a rectangular area to be extracted into an array variable
        Highlighting for array variable

The window creates the Extract action.

Note: If you are doing a flow recording, then after you finish the recording and save the updated flow you can see the mapping for the Extract action in the appropriate mapping routine inside the mapping file for the flow.


Feedback