After jobs A and B complete successfully, a different group of jobs needs to run based on what time it is. If the time that job B completes successfully is prior to 15:00, the server should run jobs C and D. If the time is 15:00 or later, the server should run jobs E and F.
The dependencies look like this:

To run different jobs based on the time a predecessor job completes
if (WOB._RHH < '15')
{
execCommand('C','%(APPL._name).%APPL._gen','ACTION REQUEST');
execCommand('D','%(APPL._name).%APPL._gen','ACTION REQUEST');
}
else
{
execCommand('E','%(APPL._name).%APPL._gen','ACTION REQUEST');
execCommand('F','%(APPL._name).%APPL._gen','ACTION REQUEST');
}
execCommand('CHECK.TIME','%(APPL._name).%APPL._gen','ACTION COMPLETE');
After job B completes successfully, the server uses a task (for example, CHECK.TIME) that runs a JavaScript script to check the actual time. If the time is prior to 15:00, the server requests jobs C and D. If the time is 15:00 or later, the server requests jobs E and F. In either case, the server completes the task to enable the successors to run. The request jobs that are not requested are automatically bypassed.
A task is used in this example so that the server can check the time and take action before all of the successor jobs are released.
Built-in variables are used on each execCommand to represent the name of the Application and the generation number to ensure the actions are performed against the correct generation of the Application.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |