HCL Workload Automation, Version 9.4

Creating a workload application template

How to define a workload application template using the Dynamic Workload Console.

Before you begin

To ensure the workload automation solution can be easily reproduced in another environment, there are some best practices to consider when creating the workload application template:
Job definitions
Jobs that refer to elements that are dependent on the environment or topology in which they reside, such as web service jobs, file transfer jobs, and database jobs to name a few, should make use of variables when specifying these elements such as credentials, paths, and port numbers. Variables can be managed in the mapping file so that the correct values can be assigned to the variable.
Workstation names
When jobs and job streams are extracted from the workload application during the export process, the names of the workstations are extracted as they are found in the source environment. Meaningful names or a standardized naming convention can simplify the mapping process.
Users
Users are also extracted as they are found in the source environment. If the same user is not present in both source and target environment, then variables should be used to specify the user.
Mapping file
The mapping file should be maintained after performing the import process. It can be useful in the case where you want to replace a workload application or update it making the necessary changes to the mapping file.
Job stream variable table
All of the variables used to generically represent objects in the workload application should be added to a specific variable table related to the job stream in the workload application. This enables the customization of the job stream to reflect the target environment through the mapping file. Avoid associating the default variable table to a job stream. The default variable table is extracted like any other table and will need to be renamed, otherwise, the import process fails because a table with the same name already exists. The target environment already has a default variable table, MAIN_TABLE, defined.
Run cycle variable table
All of the variables used to generically represent objects in the workload application should be added to a specific variable table related to the run cycle in the workload application. This enables the customization of the run cycle to reflect the target environment through the mapping file. Avoid associating the default variable table to a run cycle. The default variable table is extracted like any other table and will need to be renamed, otherwise, the import process fails because a table with the same name already exists. The target environment already has a default variable table, MAIN_TABLE, defined.

About this task

From the Workload Designer, you can create the template of a workload that can then be imported and run in another environment. You can create a workload application template containing one or more job streams with all the related jobs and internal or external dependencies (such as files, resources, prompts) so as to have a self-contained workflow. You can then export the workload application template to deploy and run it in another environment. To create a workload application template, perform the following procedure:

Procedure

  1. From the navigation toolbar, click Administration > Workload Design > Manage Workload Definitions
  2. Specify the name of a distributed engine. The Workload Designer opens.
  3. In the Working List pane, select New > Workload Application Template. The workload application template is created in the Details view and its properties page is displayed.
  4. In the properties pane, specify the attributes for the workload application template that you are creating:
    Name
    Mandatory field that contains the name of the workload application template. The maximum length is 80 characters.
    Description
    Optional descriptive text to help workload application users understand the purpose and characteristics of the workload application. The maximum length is 120 characters.
    Provider
    Optional field that specifies the creator of the workload application template. It can be useful to let workload application users know who created and provided it. The maximum length is 120 characters.
  5. From the Details view, right-click the workload application template and click Add Job Stream to add job streams to it.
  6. From the lookup dialog, select the job streams that you want to add. Together with the job streams, the corresponding dependencies are automatically also added to the workload application template.
  7. Click Save to save the workload application template in the database.
  8. Right-click the workload application template and click Export to produce a compressed file, named workload application template name.zip, containing all the files and information required to allow the workload to run also in another environment.

Results

The compressed file contains:
workload application template name_Definitions.UTF8.xml
XML file that contains the definitions of all the exported objects. These definitions will be deployed in the target environment to populate the target database with the same objects existing in the source environment. The objects in the definition file can remain as they are or you can choose to rename them. If an object does not have a definition in the definition file, for example, a workstation, then at import time, a corresponding object will not be created in the target environment. The expectation is that such object is already present in the target environment, therefore, for these types of objects, you must map them in the mapping file.
workload application template name_Mapping.UTF8.properties
Mapping file that is used to replace the names of the objects in the source environment with the names that these objects have in the target environment. The objects that will be created in the target environment can be created with the same names as those in the source environment or you can specify a different name in this file.
When the import process is performed from the wappman command line, you can optionally request that the mapping file is automatically modified according to rules defined using regular expressions and specified in one of the following ad-hoc files:
  • workload application template name_BasicRegExpMapping.UTF8.rules
  • workload application template name_AdvancedRegExpMapping.UTF8.rules
These files are produced by the export process and, if used, must be properly customized.
workload application template name_SourceEnv_reference.txt
Reference information containing the definitions of the workstations used in the workload application template and other information that can be useful to correctly map the source environment into the target environment so as to allow the workload application to run.
workload application template name_BasicRegExpMapping.UTF8.rules
A file containing rules, defined using basic regular expressions, to modify the mapping file. Optionally customize the file according to the names that the objects will have in the target environment. The import process performed from the wappman command line then applies the defined rules to modify the mapping file.
workload application template name_AdvancedRegExpMapping.UTF8.rules
A file containing rules, defined using advanced regular expressions, to modify the mapping file. Optionally customize the file according to the names that the objects will have in the target environment. The import process performed from the wappman command line then applies the defined rules to modify the mapping file.

You can import the compressed package from the Dynamic Workload Console with an intuitive guided procedure, as described in Importing a workload application template.

You can also use the wappman command line to manually import the compressed package into the target environment where the workload application will be deployed, thus creating all the required objects in the target environment. In the target environment, the workload application name_Mapping.UTF8.properties file must be modified, manually or using regular expression mapping files, by specifying the names of the objects as they are defined in the target environment (for example, the names of the workstations on which the job streams run). If importing the workload application template from theDynamic Workload Console, the user interface provides the possibility to specify the names of the objects in the target environment. For more details, see the topic about managing workload applications in the User's Guide and Reference.