HCL Workload Automation, Version 9.4

Sample condition examples

The following sections summarize how to construct simple or more complex parameter sets.

Simple branch, long branch scenarios

This function uses the default values:

  • CONDITION_SWITCH=PARENT_SUCCESS
  • ACTION_SWITCH=CANCEL

You do not need to specify any input parameters for these scenarios. The default values are supplied automatically by the branch job.

Pause action

This function needs at least one fixed parameter. You must use at least two branch jobs to implement the pause and release scenario.

To use the pause and release function, you must override the default behavior for the first branch job. The name of the branch job in this example is BRANCH_1. If the name of your branch job has a different suffix (for example, BRANCH_5), you must adjust the separator names.

The second branch job in the pause and release approach does not need any input parameters if it dependents only on its parent's status (SUCC).

The following is the complete syntax together with the parameter separators:

BRANCH_1-BEGIN
ACTION_SWITCH=PAUSE
BRANCH_1-END

No indexed parameters are supplied. Indexed parameters can be used only in combination with the fixed parameter CONDITION_SWITCH=COMPLEX. Because the parameter CONDITON_SWITCH is not included, the default value CONDITION_SWITCH=PARENT_SUCCESS was used.

For information about the combination of the pause action together with the complex condition, see Complex condition with pause action.

Single pattern search

This function is represented by one subcondition and needs one fixed and one indexed parameter.

The following example shows the complete syntax together with the parameter separators. The name of the branch job is BRANCH_1. If the name of your branch job has a different suffix (for example, BRANCH_5), you must adjust the separator names.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
PATTERN_1=find this text
BRANCH_1-END

There is only one indexed parameter representing the only subcondition.

Negated pattern search

This function is represented by one subcondition and requires one fixed and two indexed parameters.

The following example shows the complete syntax together with the parameter separators. The name of the branch job is BRANCH_1. If the name of your branch job has a different suffix (for instance BRANCH_5), you must adjust the separator names.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
PATTERN_1=do not find this text
NEGATE_CONDITION_RESULT_1=YES
BRANCH_1-END

Both indexed parameters have the same suffix because they belong to the same subcondition.

Multiple pattern search

This function is represented by several subconditions and needs one fixed and several indexed parameters.

In this example, you search for two independent patterns within the parent job log. You create two separate subconditions, each with its own index (1 and 2). You must also specify if both patterns must be found (using the Boolean operator AND) or if finding at least one pattern is sufficient (Boolean operator OR).

The following example shows the complete syntax, together with the parameter separators. The name of the branch job is BRANCH_1. If the name of your branch job has a different suffix (for example, BRANCH_5), you must adjust the separator names.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
PATTERN_1=find this text
PATTERN_2=find also this text
BOOLEAN_OPERATOR_2=&&
BRANCH_1-END

The indexed parameters have different suffixes.

The parameter PATTERN_1 belongs to first subcondition and the parameter PATTERN_2 belongs to the second subcondition. The parameter BOOLEAN_OPERATOR_2 specifies how the second subcondition is joined to the first subcondition.

Pattern within pattern search

This function is represented by one subcondition and needs one fixed and two indexed parameters.

In this example, you search for the text pattern within the parent job log. Then you search for another pattern within the same row. All the indexed parameters belong to one subcondition.

The following example shows the complete syntax, together with the parameter separators. The name of the branch job is BRANCH_1. If the name of your branch job has a different suffix (for example, BRANCH_5), you must adjust the separator names.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
PATTERN_1=find this text
VALUE_1=and also this text on the same row
BRANCH_1-END

Both indexed parameters have the same suffix because they belong to the same subcondition.

Pattern search with numeric comparison

This function is represented by one subcondition and requires one fixed and three indexed parameters.

You search for a text pattern within the parent job log. Then you search for a number within the same row. You want to compare this number against another number that we supply as the input parameter. For the arithmetical comparison, you use the arithmetical operator that you supply as the input parameter.

All the indexed parameters belong to one subcondition.

The following example shows the complete syntax, together with the parameter separators. The name of the branch job is BRANCH_1. If the name of your branch job has a different suffix (for example, BRANCH_5) you must adjust the separator names.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
PATTERN_1=Total backup size
VALUE_1=500
ARITHMETICAL_OPERATOR_1=-lt
BRANCH_1-END

All three indexed parameters have the same suffix because they belong to the same subcondition.

The meaning of the functions invoked by the parameters specified can be represented as follows:
  1. Get the parent job log.
  2. Extract the row containing the string Total backup size.
  3. If (row found):
  4. Then continue with the next step
  5. Else return FALSE
  6. Try to extract numeric value from the row.
  7. If (number found):
  8. Then continue with the next step
  9. Else return FALSE
  10. If (number_from_joblog < 50):
  11. Then return TRUE
  12. Else return FALSE

Combination of pattern search and pause action

A non-default condition can be combined with a non-default action. This means that we use entries for both CONDITION_SWITCH and ACTION_SWITCH in this scenario.

We demonstrate how to combine single pattern searching together with the pause action.

This function is represented by one subcondition and needs two fixed parameters and one indexed parameter.

The following example shows the complete syntax, together with the parameter separators. The name of the branch job is BRANCH_1. If the name of your branch job has a different suffix (for example, BRANCH_5), you must adjust the separator names.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
ACTION_SWITCH=PAUSE
PATTERN_1=find this text
BRANCH_1-END

Both fixed parameters are overridden. The one indexed parameter belongs to the one subcondition.

Signal action

Different separators are required for the signal scenario.

Two jobs are managing the job stream's workflow:

  • The signal job
  • The branch job

Only the signal job uses the input parameters.

The name of the signal job consists of the string SIGNAL and the suffix, therefore the parameter separators look different. Also, for the signal job, the common rules are valid. The parameter separators must look exactly like the related job name.

This scenario shows the difference together with the parameters for the signal action. The signal action is combined with the condition based on the pattern search within the parent job log.

The signal function is represented by one fixed parameter. The pattern search requires one fixed parameter for the condition type and one indexed parameter specifying the pattern search.

The following example shows the complete syntax, together with the parameter separators. The name of the branch job is BRANCH_1. If the name of your branch job has a different suffix (for example, BRANCH_5), you must adjust the separator names.

SIGNAL_1-BEGIN
CONDITION_SWITCH=COMPLEX
ACTION_SWITCH=SIGNAL
PATTERN_1=find this text
SIGNAL_1-END

Complex condition with pause action

The complex condition can be combined with the non-default action.

The complex condition is described in Complex scenario - Multiple conditions. In this scenario, the complex condition is combined with the pause action.

The following example shows the complete syntax, together with the parameter separators. The name of the branch job is BRANCH_1. If the name of your branch job has a different suffix (for example, BRANCH_5), you must adjust the separator names.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
ACTION_SWITCH=PAUSE
PATTERN_1=Error
NEGATE_CONDITION_RESULT_1=YES
PATTERN_2=Free space on Primary device
VALUE_2=50
ARITHMETICAL_OPERATOR_2=-gt
BOOLEAN_OPERATOR_2=&&
PATTERN_3=Free space on Secondary device
VALUE_3=60
ARITHMETICAL_OPERATOR_3=-gt
BOOLEAN_OPERATOR_3=||
BRANCH_1-END

The meaning of the definition is as follows:

  • Subcondition_1: If you find pattern Error, return FALSE, else return TRUE. The inverted result is accomplished by the NEGATE_CONDITION_RESULT_1 parameter.
  • Subcondition_2: Search for the row containing Free space on Primary device. Extract the number from the row. If the number is greater than 50, return TRUE, else return FALSE.
  • Subcondition_3: Search for the row containing Free space on Secondary device. Extract the number from this row. If the number is greater than 60, return TRUE, else return FALSE.
  • Join these three subconditions by using Boolean operators so that the complex condition is constructed as follows:
    1. If (subcondition_1 = TRUE) AND (subcondition_2=TRUE) OR (subcondition_3=FALSE)
    2. Then return TRUE
    3. Else return FALSE
    4. If (complex_condition_result=TRUE)
    5. Then CANCEL bad_branch
    6. Else PAUSE the good_branch

For more information about the pause and release concepts, see Pause and Release actions scenario.

Multiple branch jobs within one job stream

You can define parameters for several branch jobs that are defined in the same job stream. Having more than one branch job within a job stream means that the different parameter sets are enclosed by different separators .

The following example shows the complete syntax, together with the parameter separators. The names of the branch jobs are BRANCH_1 and BRANCH_2. If the name of your branch jobs have different suffixes (for example, BRANCH_5 and BRANCH_6), you must adjust the separator names.

BRANCH_1-BEGIN
CONDITION_SWITCH=COMPLEX
PATTERN_1=Error
NEGATE_CONDITION_RESULT_1=YES
PATTERN_2=Free space on Primary device
VALUE_2=50
ARITHMETICAL_OPERATOR_2=-gt
BOOLEAN_OPERATOR_2=&&
PATTERN_3=Free space on Secondary device
VALUE_3=60
ARITHMETICAL_OPERATOR_3=-gt
BOOLEAN_OPERATOR_3=||
BRANCH_1-END

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