Rational Developer for System z

Generating a HATS macro for the HATS runtime environment

This topic describes the steps for generating a HATS macro for the HATS runtime environment.

Before you generate a HATS macro, see the restrictions described in Limitations on features and capabilities when generating HATS macros or when playing flows.

Part 1. Create a generation properties file

Use the New Generation Properties wizard to create a generation properties file. The generation properties file contains various parameters that are required by the Generate Runtime Code wizard in Part 3.

To use the New Generation Properties wizard:

  1. Start the New Generation Properties wizard:
    1. In the EST Project Explorer, right-click the flow for which you want to generate a new generation properties file (for example, MySFP_0001.seqflow).

    2. Select New > Generation Properties File.

    The New Generation Properties wizard opens.

    Note: Alternatively, to start the wizard, you can follow these steps:
    1. From the workbench's main menu, select New > Generation Properties File.

    2. The New Generation Properties wizard opens.

    If you have not selected a flow, then you can specify the flow on the first page of the wizard.

  2. On the first page of the wizard, called Generation Properties - New File, complete the fields as follows:
    • In the File name field, enter a name for the file that will be used to store the generation properties.
    • The Destination project field should already be populated with the project containing the selected flow.
    • The Flow field should already be populated with the selected flow.
    • Select the Validate flows against runtimes check box to have the wizard determine whether the selected flow can be used to generate runtime code for each of the supported runtime environments.
      • This level of validation checks only whether the types of the nodes in the selected flow are valid for each of the supported runtime environments. A more thorough validation is done when the code is generated for the runtime environment.
      • The results of this validation display on the next page of the wizard. If the selected flow can be used to generate code for a runtime environment based on this level of validation, then the selection for that runtime environment is enabled. Otherwise, the selection is disabled.

  3. Click Next. The Generation Properties - Runtime selection page opens.

  4. Select Host Access Transformation Services. If this selection is not available, and you selected the Validate flows against runtimes check box on the previous page, then the flow contains one or more nodes of a type that is not supported by the HATS runtime environment.

    Additional restrictions on the HATS that might cause the validation to fail include:
    • Invoke nodes must be associated with screen operations.

  5. Click Finish.

  6. The New Generation Properties wizard performs the following:
    1. Creates a default generation properties file for the HATS macro, and gives the file the name that you specified.
    2. Stores the file in Generation > HATS > [flow name].
    3. Closes.

When the New Generation Properties wizard terminates, Enterprise Service Tools automatically opens the new generation properties file with the generation properties editor.

Part 2. Modify the generation properties if required

Use the generation properties editor to modify any generation properties that you want to modify:

  1. The generation properties editor displays the generation properties.

    Note: The generation properties editor displays only one set of properties, because only a single HATS macro will be generated using this generation properties file. You cannot select individual nodes to modify.
  2. Modify any generation properties that you want to modify (see Generation properties for the HATS runtime environment).

  3. Save your changes and close the editor.

Part 3. Run the Generate Runtime Code wizard

Generate the HATS macro using the Generate Runtime Code wizard:

  1. Start the Generate Runtime Code wizard:

    1. In the EST Project Explorer, right-click the generation properties file that you modified in Part 2.

      Note:

      Alternatively, in the Flows folder, you can right-click any flow. Then you can specify a particular generation properties file on the first page of the wizard.

    2. Select Generate > Generate Runtime Code.

      Note: If you have not selected a generation properties file then the Generate Runtime Code wizard allows you to select one. If no generation properties file exists then the service flow project tools prompt you to create one.

    The Generate Runtime Code wizard opens.

  2. On the first page of the Generate Runtime Code wizard, called File Selection, complete the fields as follows:
    • The File name field should already be populated with the selected file.
    • To send the code to another location, select the Generate to another location check box.

  3. For local generation, click Finish and proceed to step 5 below.

  4. For remote generation, click Next. The Selection of target locations page opens. Complete the fields as follows:
    • Browse to locate the service flow project where you want to store the HATS macro.
    • Click Finish.

  5. The Generate Runtime Code wizard generates the runtime code from the information in the specified generation properties file. The generation process takes a few seconds to complete. A results message displays and states whether the generation was successful or not. Click Details to view messages regarding the code generation.

    The Generate Runtime Code wizard stores the macro in Generation > HATS > flow name in either the selected project (local generation) or in a specified folder on a remote z/OS® systems (remote generation). The macro name is the same as the name of the flow from which the macro was generated plus the extension .hma

  6. If desired, verify the generated file structures as follows:
    1. Refresh the project folder in your workspace. The .hma file displays.
    2. Open the file to verify the contents are correct.

The Generate Runtime Code wizard stores the macro in Generation > HATS > [flow name] in either the selected project (local generation) or in a specified folder (remote generation). The macro name is the same as the name of the flow from which the macro was generated plus the extension .hma

Part 4. Check the results from running the Generate Runtime Code wizard

After the Generate Runtime Code wizard closes you should check the results to verify that the actions that you intended have been carried out and that no errors have occurred.

Note: For information about error messages or warning messages displayed by the Generate Runtime Code wizard see Error messages displayed by the Generate Runtime Code wizard.

Here is a checklist of results to verify:

  1. Check for any error messages or warnings:

    • GENERATION SUCCESSFUL (POSSIBLY WITH WARNINGS):
      If the Generate Runtime Code wizard did not encounter any significant problems during code generation then after the code generation is complete the wizard opens the Runtime Code Generation Complete window. In this window:
      1. Click Details. The wizard displays a pane containing a list of the files that the wizard generated.
      2. Verify that the output file or files that you expected to be generated are listed.
      3. Also check this same list for warning messages.
        Note: To learn more about a particular warning message see the information provided with the warning number in Error messages displayed by the Generate Runtime Code wizard.
      4. Click OK to close the window.

    • GENERATION ERROR:
      If the Generate Runtime Code wizard did encounter a significant problem during code generation then the wizard opens the Generation Error window. In this window:
      1. Click Details. The wizard displays a list containing one or more error messages describing the specific problem or problems that the wizard encountered.
        Note: To learn more about a particular error see the information provided with the error number in Error messages displayed by the Generate Runtime Code wizard.
      2. Click OK to close the window.

  2. Verify that the output file or files were generated:
    1. Refresh the output folder (see Step B1. Decide on a target destination for the output files).
    2. Verify that the output file or files that were listed in the Details pane have been generated.
Note: If an <input> element in a generated HATS macro includes an AID key, then the element also includes the row and column position of the cursor when the AID key was pressed.

Feedback