Setting up conditional dependencies
You can set up conditional dependencies to define workflows with alternative branches based on conditions.
Using conditional dependencies, you can control when a successor job starts depending on the combination of one or more mapping expressions (for example, return codes) or statuses of a predecessor job.
Example:
The DB_BACKUP job runs if the ABSENCES job satisfies the
condition associated with STATUS_OK. The OPERATOR_INTERVENTION job
runs if the ABSENCES job satisfies the condition defined for
STATUS_ERR1.


To set up this type of job processing, create the
ABSENCES job definition
and define the conditional dependencies.- Create the
ABSENCESjob definition:- Open the Dynamic Workload Console.
- From the Design menu, select Graphical Designer.
- Create a new workspace.
- From the canvas, select the Assets tab and click the Add button (+).
- From the drop-down menu, select Job definition.
- In the search bar, select a job type and click Next.
- Define information about the job, and name it
ABSENCES.
- Define the conditional dependencies:
- In the Output conditions section, under Successful output conditions, click the Add button (+).
- Enter STATUS_OK as condition name, and set
RC=0as condition value. - In Other output conditions, click the Add button (+).
- Enter STATUS_ERR1 as condition name, and set
RC=2as condition value. - Click Add to add the job definition to the database.
- Create the
DB_BACKUPand theOPERATOR_INTERVENTIONjobs. - Create the
PAYROLLjob stream:- From the Blocks tab, drag a job stream onto the canvas,
name it
PAYROLLand define information about it.
- From the Blocks tab, drag a job stream onto the canvas,
name it
- Add the
ABSENCES,DB_BACKUPandOPERATOR_INTERVENTIONjobs to thePAYROLLjob stream:- From the Assets tab, drag the
ABSENCES,DB_BACKUPand theOPERATOR_INTERVENTIONjobs onto thePAYROLLjob stream.
- From the Assets tab, drag the
- Define the internal conditional dependencies:
- From the
ABSENCESjob block, drag a connecting arrow to theDB_BACKUPconnection point. - From the Internal predecessor panel, in General information, expand the Output conditions menu and select STATUS_OK.
- From the
ABSENCESjob block, drag a connecting arrow to theOPERATOR_INTERVENTIONconnection point. - From the Internal predecessor panel, in General information, expand the Output conditions menu and select STATUS_ERR1.
- From the
- Job definition
-
WK1#ABSENCES SCRIPTNAME "myscript.sh" STREAMLOGON root DESCRIPTION "Sample Job Definition" TASKTYPE UNIX SUCCOUTPUTCOND STATUS_OK "RC=0” OUTPUTCOND STATUS_ERR1 “RC =2” RECOVERY CONTINUE END - Job stream
-
SCHEDULE WK1#PAYROLL ON RUNCYCLE RULE1 "FREQ=DAILY;" AT 1800 CARRYFORWARD : WK1#DB_BACKUP FOLLOWS WK1#ABSENCES IF STATUS_OK WK1#OPERATOR_INTERVENTION FOLLOWS WK1#ABSENCES IF STATUS_ERR1 END