AX1764
Scheduler task: Run Scheduler Job
This task runs a specified Scheduler job as a subordinate job within the current job. The job containing the Run Scheduler job task is the parent job, and the target job for the task is the child job.
By default, the parent job waits until the child job is complete before continuing to the next task in the parent job. This means that tasks after the Run Scheduler Job task can be reference the results of the child job. For example, the child job may perform a save-to-database. The subsequent tasks in the parent job can access the data saved by the child job.
Task Control options
When you create the Run Scheduler Job task, the options in the Task Control section are pre-set as follows:
-
The option Create a Subordinate Job for this Task is grayed out. This is because the target job is always run as a subordinate job.
-
The option Wait for all Subordinate Jobs to complete before proceeding to the next Task is enabled by default. This means that tasks after the Run Scheduler Job task can be dependent on the target job and reference the results of that job. If you disable this option, then the parent job will continue to the next task in the job immediately after creating the subordinate job—it will not wait for the subordinate job to complete.
Keep in mind that it is not possible to stop processing tasks in the parent job based on the success or failure of the child job. Although Scheduler jobs automatically stop processing if a task fails, the task in this case is just the Run Scheduler Job task. As long as the child job can be successfully added to the Scheduler queue for processing, the Run Scheduler Job task will report success. The ultimate success or failure of that child job is not reported back to the parent job—the parent job only knows when the child job is started and then stopped.
If needed, you can use the option Process task only if the value of this expression is true to detect whether a subsequent task in the parent job should be processed. For example, if you know that the child job saves a particular value to the database, you can check for the existence of that value to determine whether to process the task. For more information on using this option, see Conditionally processing tasks in a job.
Target Scheduler job
In the Task Details section, use the Browse button to select the target Scheduler Job. You can select any job that you have access to in the Scheduled Jobs Library.
When the Run Scheduler Job task is executed, it creates one or more subordinate jobs as needed to execute the tasks in the target Scheduler job. As long as Wait for all Subordinate Jobs to complete before proceeding to the next Task remains enabled in the Task Control options, the parent job waits for all subordinate jobs to be completed before moving on to the next task in the parent job.
NOTE: The user executing the job does not need to have security access to the target Scheduler job for Run Scheduler Job. It is assumed that if the user can execute the parent job, the user should be able to execute the target job.
Child Job Values
If the target job for the Run Scheduler Job task has defined job variables, those variables and their default values are listed in this section. The default values are determined as follows:
-
If the parent job and the child job have a variable with the same name, the default value is the value defined in the parent job. This value will be passed to the child job and used when the child job is run.
-
Otherwise, the default value is the value defined in the child job.
To override a variable value, select the Override check box and then click inside the Override Value field to enter a value. You can enter a hard-coded value or use a job variable from the parent job. Enter the variable name in curly brackets to use that variable's value as the override value.
For example, imagine that both the parent job and the child job have a variable of {Dept}
. In the parent job, the value of {Dept}
is set to 20000, and in the child job the value is set to 40000. The Run Scheduler Job task will display the parent value of 20000 as the default value, and that value will be used when the child job is executed.
Now imagine that the parent job has a variable of {StartDept}
set to 20000, and the child job has a variable of {Dept}
set to 40000. In this case, the Run Scheduler Job task will display the value of {Dept}
as defined in the child job (40000). If you want to use the parent job value for {StartDept}
instead, then you must select the Override check box and enter {StartDept}
as the Override Value. Now the value of {Dept}
in the child job will be overridden and set to 20000.