HCL Workload Automation, Version 9.4

Complex branch - Pattern

Use the complex branch pattern scenario to search for a specific text pattern within the parent job log.

Pattern scenario usage

You can search for any string, for example ended successfully or mounted ALL tape drives. In general, the text must represent the positive message included in the parent job log.

Note: Pattern search usually looks for the positive message from the parent job log. In some cases, you might want to implement reversed logic, for example search for the pattern Error , Unsuccessfully, or Not Enough Space, which represent negative messages from the log. To use this approach, see Complex branch - Negated pattern.

Using the pattern branch, if the text pattern is found, then CONDITION=TRUE otherwise CONDITION=FALSE.

Figure 1 shows the job stream definition for the pattern branch scenario. The job stream seems similar to the simple branch scenario, but additional parameters are defined:

  • CONDITION_SWITCH=COMPLEX
  • PATTERN_1=completed successfully
Figure 1. Pattern scenario - definitionDefinition of a job stream searching for a string that is positive to you in the parent job log.

The pattern scenario 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_PATTERN
STREAM_CPU=SYDNEY
BRANCH_JOB_NAME=BRANCH_1
PARENT=PATTERN_JOB
========================================================
============= Input parameters =============
CONDITION_SWITCH=COMPLEX
ACTION_SWITCH=CANCEL
CONDITION_COUNT=1
PATTERN[1]=completed successfully
IS_CASE_SENSITIVE[1]=YES
IS_REGULAR_EXPRESSION[1]=NO
NEGATE_CONDITION_RESULT[1]=NO
========================================================
============= MAIN DECISION MAKING =============
COMPLEX condition evaluation
----------ATOMIC CONDITION 1------------
Searching for "completed successfully" in JOBLOG of PATTERN_JOB
Pattern FOUND, performing further tests.
No additional value defined for specified pattern. 
Condition evaluated as TRUE.
ATOMIC CONDITION RESULT [1]= TRUE
-------------------------------------
-------- COMPLEX CONDITION ----------
[ TRUE ]
CONDITION_RESULT=TRUE
TRUE: The result of complex condition is TRUE.
==========================================================
============= Action on STOP Branch =============
Performing action CANCEL on job SYDNEY#0AAAAAAAAAAAAED4.B_DO_THE_BAD_THING
%cj SYDNEY#0AAAAAAAAAAAAED4.B_DO_THE_BAD_THING;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_PATTERN[(1733 12/17/07),
   (0AAAAAAAAAAAAED4)].B_DO_THE_BAD_THING
==========================================================
============= Action on RUN Branch =============
Performing action RELEASE on job SYDNEY#0AAAAAAAAAAAAED4.G_DO_THE_GOOD_THING
Releasing of job SYDNEY#0AAAAAAAAAAAAED4.G_DO_THE_GOOD_THING is NOT NECESSARY, 
   because priority=10
==========================================================
============= Statistics of branch job BRANCH_1 =============
TRUE: The result of complex condition is TRUE.
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
PAUSED_JOB:
RELEASED_JOB:
============ END of branch job BRANCH_1 ==========

Required input parameters

Table 1 shows the parameters required for the pattern scenario.

Table 1. Input parameters for the pattern job scenario
Parameter name Parameter value
CONDITION_SWITCH COMPLEX
PATTERN_1 Completed successfully

The following example shows the parameter definition. The text is entered into the Comments field of the job stream definition.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
PATTERN_1=completed successfully
BRANCH_1-END

For a description about how to specify the parameters for the branch job, see Working with the branch job parameters.

Placing the branch job into the job stream

Put the generic branch job into 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.