Overview
In many cases, a job should run only after some external requirements are satisfied. For example, a job may need data generated by another job, or it can run only after another job has completed successfully.
Enteprise Scheduler has the flexibility to encompass the different scheduling needs encountered in a business environment. You use job dependencies to prevent a job from running until the preceding job completes or enters a predefined status. You can also set jobs to run only when manually released.
In this chapter, we are going to define (add) a job called
Inv21
. We will assign a calendar to this job, but we will also make it
Require operator release
. Even if according to its calendar, the job is due to run, it does not run until it is released from
Waiting on Operator
status. We will define a second job,
Inv22
, which depends on
Inv21
.
Inv22
does not run until
Inv21
completes normally. Finally, we release
Inv21
, and both jobs end with a
Completed Normally
status.
Figure 5-1 Interdependence of Inv21, Inv22, and the Operator
This chapter describes how to:
-
Define a job that waits for an operator to release it
-
Define a job that depends on the completion of another job
-
Monitor jobs and job dependencies
-
Release a job that requires operator intervention
Note To complete the exercises in this tutorial, you need to:
-
Install
Enteprise Scheduler
in the default directory Scheduler (or the examples in this tutorial will not work properly)
-
Select the
Super User
option in your User definition
-
Configure a default agent
-
Create and have available the work day calendar
Defining a Job for Operator Release
You can define a job requiring an operator to release it manually before running, after all its other dependencies are satisfied. Before the job is released, it enters the
Waiting on Operator
status. The job definition can include instructions for the operator.
Requiring an operator release is a good technique when testing a job or a set of sequential jobs for the first time. This is also good for jobs requiring operators to verify an event, or perform a related operation external to Enteprise Scheduler.
Setting the Require Operator Release Option
To set the Require Operator Release option:
1. From the
Navigator
pane, select
Definitions>Jobs
to display the
Jobs
pane.
2. Right-click in the
Jobs
pane of the console and select
Add Job
from the context menu, or click the
Add Job
button on the Enterprise Scheduler toolbar.
The
Job Definition
dialog displays.
3. Set the following options:
a. In the
Job Name
field, enter the name
Inv21
.
b. In the
Command
field, enter the full path to
Inv21.bat
.
Note Although the command executable has the same name as the job in this case, this is not required. The Job Name is any logical name that is meaningful to you. However, the command name refers to the physical file and must match the actual command.
4. Click the
Schedule
tab.
5. In the
Calendar Name
list and select the
work day
calendar.
6. Click the
Options
tab.
7. Select the
Require operator release
option.
8. Click
OK
to save the job definition.
9. Click
OK
in the
Effective Date
dialog to submit the job into today’s schedule.
10. From the
Navigator
pane, select
Operations>Job Activity
to display the
Job Activity
pane.
Inv21
displays a
Waiting On Operator
status.
We will leave this job for now, and release it to the Production Schedule later after creating a second job with a dependency on
Inv21
completing normally.
Adding a Job with a Dependency
We will now create the
Inv22
job definition with a dependency on the
Inv21
job already in the production schedule.
To create the Inv22 job definition with a dependency on the Inv21 job:
1. From the
Navigator
pane, select
Definitions>Jobs
to display the
Jobs
pane.
2. Right-click in the
Jobs
pane of the console and select
Add Job
from the context menu, or click the
Add Job
button on the Scheduler toolbar.
The
Job Definition
dialog displays.
3. Set the following options:
a. In the
Job Name
field, type the name
Inv22
.
b. In the
Command
field, enter the full path to
Inv22.bat
.
4. Click the
Schedule
tab.
5. In the
Calendar Name
list, select the
work day
calendar.
6. Display the
Dependencies
tab, by clicking its tab on the
Job
Definition
dialog.
7. Click the
Add
button to display the list.
8. Select the
Add Job Dependency
option to display the
J
ob Dependency Definition
dialog.
9. Go to the
Job/Group
list, click the
down arrow
button and select
Inv21
. It will appear in the
Job/Group
field.
10. Accept the defaults and click
OK
. The defaults are preset to satisfy the dependency when
Inv21
completes normally.
Now
Inv21
shows as a dependency for
Inv22
. The
Inv21
dependency is part of the job definition of
Inv22
.
11. Click
OK
in the
Job Definition
dialog to close it.
12. Click
OK
in the
Effective Date
dialog.
The
Inv22
job is added to the production schedule.
Monitoring Your Jobs
Both jobs are now scheduled and ready to run. Use the
Job Activity
pane to monitor them.
From the
Navigator
pane, select
Operations>Job Activity
to display your scheduled jobs.
Figure 5-2 Job Activity Pane
Notice that both jobs are in waiting mode.
Inv21
needs manual intervention before it can run (Waiting On Operator) and
Inv22
is waiting for
Inv21
to complete normally
(Waiting On Dependencies).
Viewing Dependencies from the Job Activity Pane
To view the dependence
Inv22
has on
Inv21
:
1. Double-click the
Inv22
job in the
Job Activity
pane to display its
Job Detail
dialog.
2. Click the
Dependencies
tab. The dependency appears in the
Predecessors
field.
This shows that
Inv22
is waiting for
Inv21
to complete normally. Currently
Inv21
is in
Waiting on Operator
status.
Inv22
cannot run until
Inv21
goes to
Completed Normally
status.
3. Click
OK
.
Releasing the Jobs
To release the jobs:
1. Click the
Inv21
job in the
Job Activity
pane.
2. Right-click the job to display the context menu.
3. Select the
Job Control
option and then choose the
Release/Resume
option to release the job.
Figure 5-3 Selecting the Release/Resume Menu Option
The
Confirm
dialog displays.
4. Click
Yes
.
Now
Inv21
is free to run. Once complete,
Inv21
enters a
Completed Normally
status. The color of
Inv21
changes to green and then to blue (if using the default status colors), and then
Inv22
runs.
Inv22
displays similar status and color changes.
5. Click
OK
when the
Information
dialog displays.
Congratulations! In this chapter, you have defined jobs requiring manual release and a job dependency. You have scheduled and monitored your jobs through the various states until completion.