HCL Workload Automation, Version 9.4

Complex branch - Negated pattern

This is the inverted case of the pattern branch scenario.

Negated pattern scenario usage

With the pattern branch scenario you search the parent job log for a pattern considered as a positive message (for example, completed successfully). If, instead, you want to search for a negative message (for example, Error) use the generic branch job to negate each defined subcondition of the complex condition. In this scenario, finding the pattern results as CONDITION=FALSE. Not finding the pattern results as CONDITION=TRUE.

Figure 1 shows the job stream definition for the pattern branch scenario, with the following parameters:

  • CONDITION_SWITCH=COMPLEX
  • PATTERN_1=Error
  • NEGATE CONDITION_RESULT_1=YES
Figure 1. Negated Pattern scenario definitionDefinition of a job stream searching for a string that is negative for you in the parent job log .

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

Required input parameters

Table 1 shows the parameters required for the negated branch scenario.

Table 1. Input parameters for the negated pattern job scenario
Parameter name Parameter value
CONDITION_SWITCH COMPLEX
PATTERN_1 Error
NEGATE_CONDITION_RESULT_1 YES
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=Error
NEGATE_CONDITION_1=YES
BRANCH_1-END

For a description about how to specify the parameters for the branch job, see Specifying 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.