HCL Workload Automation, Version 9.4

Pattern within pattern row - Negated

While in the negated pattern scenario you negate the result of a simple pattern search, in the negated pattern within pattern row scenario you use the negated approach for any complex scenario. It is the reversed case of the pattern within pattern row scenario.

Negated pattern within pattern row scenario usage

Whether you are performing a simple pattern search, for example searching for the occurrence ERROR in the parent job log, or a complex condition, you can use the approach that negates the result.

Decide how to parse the parent job log. Based on your understanding of the job log content, choose whether the output of rows contains a positive or negative message. Based on this knowledge, decide whether to negate the particular subcondition result or leave it as it is.

The evaluation logic for the negated pattern within pattern row scenario is the following:

  1. Search for the pattern row.
  2. Search for the main identifier, such as Backup on Primary device.
  3. If the row is found, search for the negative message ERROR within it.
  4. Negate the result.

This approach covers the scenario where you use outputs like SUCCESS, OK, and COMPLETED as positive messages, and outputs like FAILED and ERROR as negative messages.

Figure 1 shows the definition for the pattern branch scenario.

Figure 1. Pattern within pattern row negated definitionDefinition of a job stream searching for a pattern, then another pattern in the same row, when you want to use the approach that negates the result.
Note: In any scenario where you use a complex condition, you can also negate the result of each particular subcondition. You can also set multiple atomic subconditions and negate only some of them. For detailed information, see Complex scenario - Multiple conditions.

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_PAT_PAT_NEG
STREAM_CPU=SYDNEY
BRANCH_JOB_NAME=BRANCH_1
PARENT=PATTERN_PATTERN_ERROR_JOB
==========================================================
============= Input parameters =============
CONDITION_SWITCH=COMPLEX
ACTION_SWITCH=CANCEL
CONDITION_COUNT=1
PATTERN[1]=Backup of Primary device
VALUE[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 "Backup of Primary device" in JOBLOG of 
   PATTERN_PATTERN_ERROR_JOB
Pattern FOUND, performing further tests.
Searching for STRING=ERROR within the 
   row "Backup of Primary device: ERROR".
String "ERROR" found within the 
   row "Backup of Primary device: ERROR".
==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#0AAAAAAAAAAAAEEA.G_DO_THE_GOOD_THING
%cj SYDNEY#0AAAAAAAAAAAAEEA.G_DO_THE_GOOD_THING;schedid;noask
Command forwarded to batchman for SYDNEY#GBJ_PAT_PAT_NEG[(1941 12/17/07),
   (0AAAAAAAAAAAAEEA)].G_DO_THE_GOOD_THING
==========================================================
============= Action on RUN Branch =============
Performing action RELEASE on job SYDNEY#0AAAAAAAAAAAAEEA.B_DO_THE_BAD_THING
Releasing of job SYDNEY#0AAAAAAAAAAAAEEA.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 pattern within the pattern row scenario.

Table 1. Input parameters for negated pattern within pattern row scenario
Parameter name Parameter value
CONDITION_SWITCH COMPLEX
PATTERN_1 Backup of Primary device
VALUE_1 ERROR
NEGATE_CONDITION_RESULT_1 YES

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

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
PATTERN_1=Backup of Primary device
VALUE_1=ERROR
NEGATE_CONDITION_RESULT_1=YES
BRANCH_1-END

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