Managing job definitions
The purpose of the following scenario is to show how to create a job definition in the context of an example.
About this task
David is an HCL Workload Automation user who needs to upgrade the Java version on the existing backup server named BK_server. To automate the process, David decides to create a job stream that references a job definition. David prefers to reference a job definition instead of creating an embedded job because he needs to use the same job definition in other job streams and he wants to avoid to duplicate the definition. In this way, if David needs to modify any parameter, he can modify just one job definition and every job stream that references that job definition will be affected by the change.
To create a job definition named UPGRADE_JAVA_TEMPLATE and then reference the job definition inside the existing UPGRADE_JAVA job stream, perform the following steps:
Procedure
-
Create a job definition named UPGRADE_JAVA_TEMPLATE and enter the command that
performs the Java upgrade procedure.
- From the Graphical Designer page, select the Assets tab and click the add icon +.
- From the drop-down menu, select Job definition.
- In the search bar, type Executable, then select the executable job type and click Next.
- In General information, in Workstation, select the existing workstation BK_server.
- In Folder, select IT_operations.
- In Name, type UPGRADE_JAVA_TEMPLATE.
- In Task, from the drop-down menu, select Inline script.
- In Command text or script name, enter apt install --only-upgrade openjdk-11-jre-headless -y.
- Click Add to add the job definition to the database.
-
Reference the UPGRADE_JAVA_TEMPLATE job definition into the existing
UPGRADE_JAVA
job stream.
- From the Assets, use the search bar to find the UPGRADE_JAVA_TEMPLATE job definition.
- Drag the UPGRADE_JAVA_TEMPLATE job definition into the UPGRADE_JAVA job stream.
- Click Deploy to deploy the workspace.
You created a job definition to upgrade the Java version on the backup server named BK_server and you referenced the UPGRADE_JAVA_TEMPLATE job definition into a job stream.