HCL Workload Automation, Version 9.4

Long branch scenario

Long branching is the recursive usage of simple branching.

Long branch usage

The main purpose of the long branch scenario is to show that the generic branch job can cancel all the jobs in the stop branch, even if there is a whole tree of jobs to cancel.

This function is needed because, in HCL Workload Automation, if a job is canceled, all of the job's successors are released from the FOLLOWS dependency, with the result that the jobs that are dependent on the canceled job start immediately. Because this behavior might be unwanted in some cases, the generic branch job cancels the first stop job and all of its successors.
Note: From a programming point of view, the generic branch job uses recursive function calls to go through all the successors of the first stop child of the generic branch job.

Long branch ending in the SUCC state

Figure 1 shows the job stream containing the complex structure of possible successors, either in the good or bad branch.

Figure 1. Long branch (SUCC) definitionDefinition of a job stream performing long branching, with several possible successors.

If the parent ended in SUCC state, the job log shows the following output:

============ START of branch job BRANCH_1 ==========
====================== Job environment =============
MASTER_PLATFORM=UNIX
STREAM_NAME=GBJ_LONG_SUCC
STREAM_CPU=SYDNEY
BRANCH_JOB_NAME=BRANCH_1
PARENT=IMPORTANT_JOB_SUCC
==========================================================
============= Input parameters =============
CONDITION_SWITCH=PARENT_SUCCESS
ACTION_SWITCH=CANCEL
==========================================================
============= MAIN DECISION MAKING =============
Evaluation dependent on PARENT_SUCCESS
TRUE: Searched for SUCC parent. Status of PARENT JOB(IMPORTANT_JOB_SUCC) is SUCC
==========================================================
============= Action on STOP Branch =============
Performing action CANCEL on job SYDNEY#0AAAAAAAAAAAAEC3.B_DO_THE_BAD_THING
%cj SYDNEY#0AAAAAAAAAAAAEC3.B_DO_THE_BAD_THING;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_LONG_SUCC[(2154 12/16/07),
   (0AAAAAAAAAAAAEC3)].B_DO_THE_BAD_THING
Performing action CANCEL on job SYDNEY#0AAAAAAAAAAAAEC3.SOME_BAD_JOB
%cj SYDNEY#0AAAAAAAAAAAAEC3.SOME_BAD_JOB;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_LONG_SUCC[(2154 12/16/07),
   (0AAAAAAAAAAAAEC3)].SOME_BAD_JOB
Performing action CANCEL on job SYDNEY#0AAAAAAAAAAAAEC3.ABEND_JOB
%cj SYDNEY#0AAAAAAAAAAAAEC3.ABEND_JOB;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_LONG_SUCC[(2154 12/16/07),
   (0AAAAAAAAAAAAEC3)].ABEND_JOB
Performing action CANCEL on job SYDNEY#0AAAAAAAAAAAAEC3.ANOTHER_JOB_IN_BAD_BRANCH
%cj SYDNEY#0AAAAAAAAAAAAEC3.ANOTHER_JOB_IN_BAD_BRANCH;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_LONG_SUCC[(2154 12/16/07),
   (0AAAAAAAAAAAAEC3)].ANOTHER_JOB_IN_BAD_BRANCH
==========================================================
============= Action on RUN Branch =============
Performing action RELEASE on job 
SYDNEY#0AAAAAAAAAAAAEC3.G_DO_THE_GOOD_THING
Releasing of job SYDNEY#0AAAAAAAAAAAAEC3.G_DO_THE_GOOD_THING 
is NOT NECESSARY, 
   because priority=10
==========================================================
============= Statistics of branch job BRANCH_1 =============
TRUE: Searched for SUCC parent. Status of PARENT JOB(
IMPORTANT_JOB_SUCC) is SUCC.
For action CANCEL-RUN_BRANCH=G_DO_THE_GOOD_THING and 
STOP_BRANCH=B_DO_THE_BAD_THING
BRANCH selected to STOP: B_DO_THE_BAD_THING
BRANCH selected to CONTINUE: G_DO_THE_GOOD_THING
CANCELED_JOBS: B_DO_THE_BAD_THING, SOME_BAD_JOB, ABEND_JOB, 
ANOTHER_JOB_IN_BAD_BRANCH
PAUSED_JOB:
RELEASED_JOB:
============ END of branch job BRANCH_1 ==========

Long branch ending in the ABEND state

Figure 2 shows how the job stream runs if the evaluated job abended.

Note: To release the successors from the FOLLOWS dependency, the evaluated job (parent job) must have the recovery option set to Continue. You can set this parameter only within the job definition, not in the job stream definition.
Figure 2. Long branch(ABEND) final statusFinal status of a job stream when the parent job abended.

The job log shows the output of the generic branch job instance:

============ START of branch job BRANCH_1 ==========
====================== Job environment =============
MASTER_PLATFORM=UNIX
STREAM_NAME=GBJ_LONG_ABEND
STREAM_CPU=SYDNEY
BRANCH_JOB_NAME=BRANCH_1
PARENT=IMPORTANT_JOB_ABEND
==========================================================
============= Input parameters =============
CONDITION_SWITCH=PARENT_SUCCESS
ACTION_SWITCH=CANCEL
==========================================================
============= MAIN DECISION MAKING =============
Evaluation dependent on PARENT_SUCCESS
FALSE: Searched for SUCC parent. 
Status of PARENT JOB(IMPORTANT_JOB_ABEND) is ABEND.
==========================================================
============= Action on STOP Branch =============
Performing action CANCEL on job SYDNEY#0AAAAAAAAAAAAEC4.G_DO_THE_GOOD_THING
%cj SYDNEY#0AAAAAAAAAAAAEC4.G_DO_THE_GOOD_THING;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_LONG_ABEND[(2159 12/16/07),
   (0AAAAAAAAAAAAEC4)].G_DO_THE_GOOD_THING
Performing action CANCEL on job SYDNEY#0AAAAAAAAAAAAEC4.SOME_GOOD_1
%cj SYDNEY#0AAAAAAAAAAAAEC4.SOME_GOOD_1;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_LONG_ABEND[(2159 12/16/07),
   (0AAAAAAAAAAAAEC4)].SOME_GOOD_1
Performing action CANCEL on job SYDNEY#0AAAAAAAAAAAAEC4.SOME_GOOD_2
%cj SYDNEY#0AAAAAAAAAAAAEC4.SOME_GOOD_2;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_LONG_ABEND[(2159 12/16/07),
   (0AAAAAAAAAAAAEC4)].SOME_GOOD_2
==========================================================
============= Action on RUN Branch =============
Performing action RELEASE on job SYDNEY#0AAAAAAAAAAAAEC4.B_DO_THE_BAD_THING
Releasing of job SYDNEY#0AAAAAAAAAAAAEC4.B_DO_THE_BAD_THING is NOT NECESSARY, 
   because priority=10
==========================================================
============= Statistics of branch job BRANCH_1 =============
FALSE: Searched for SUCC parent. Status of PARENT JOB(IMPORTANT_JOB_ABEND) is ABEND.
For action CANCEL-RUN_BRANCH=B_DO_THE_BAD_THING and STOP_BRANCH=G_DO_THE_GOOD_THING
BRANCH selected to STOP: G_DO_THE_GOOD_THING
BRANCH selected to CONTINUE: B_DO_THE_BAD_THING
CANCELED_JOBS: G_DO_THE_GOOD_THING, SOME_GOOD_1, SOME_GOOD_2
PAUSED_JOB:
RELEASED_JOB:
============ END of branch job BRANCH_1 ==========

Required input parameters

This branching type does not require any input parameters.

Placing the branch job into the job stream

Put the generic branch job in the job stream after the parent job and rename the good child with the "G_" prefix and the bad child with the "B_" prefix.

Also, follow the best practice and rename the branch job with a suffix consisting of the underscore character and a numeric value. A typical name for the first branch job within a job stream is BRANCH_1.