The PeopleTools process scheduler allows you to run jobs on a regular schedule. This wiki page goes through the two ways to set up batch scheduling using recurrences.
Batch Scheduling Terminology
However, before setting up batch scheduling, there's some terminology that you'll need to be aware of:
- A job is a collection of one or more processes that run together.
- A recurrence defines a regular event. For example a daily recurrence would be for every day of the week. A recurrence includes a start request date and time, an end request date and time, and repeat information (e.g. repeat every 1 hour for 24 hours).
- A schedule jobset definition is a job that has been scheduled to run on a regular basis (with a recurrence) using specifc run control(s) and parameters.
The navigations you'll need to know are:
- PeopleTools > Process Scheduler > Jobs
- PeopleTools > Process Scheduler > Recurrences
- PeopleTools > Process Scheduler > Schedule Jobset Definitions
Recurrences through the Process Scheduler
The first (and simplest) way to schedule something to run on a regular basis is to select a recurrence when you schedule a process through the process scheduler. For example, if you wanted to run the system audit process through system process requests each day, navigate to PeopleTools > Process Scheduler > System Process Requests then select the system audit process to be run. At the process scheduler request page, you would then select a recurrence. Here's an example screenshot.
You can use this technique for any process you can run through the process scheduler and gives you access to this page first.
Now if you go to the process monitor you'll see your SYSAUDIT process running as per normal, but it now includes a green recurrence icon after the process name that looks like this:
Note that you will probably end up with two items in the process monitor. The first item is your request running today and the second will be the queued request for tomorrow (or sometime in the future depending on your recurrence). You can see this in the screenshot above. Process instance 2173557 was initiated on 05/01/2009 and has run to success and posted. Process instance 2173558 will run on 06/01/2009 at 12:02:00 AM and is currently set to queued.
You can also click on the green recurrence icon to manage the process further. This gives you:
- The ability to hold (suspend) the recurrence. This will change the run status to Hold.
- The ability to stop the request recurring
- The ability resume the recurrence if it has been stopped or set to hold.
- A request list with a history of the process requests that have already run through this recurrence and if/when the process will recur next
Using this method works well for simple recurrences for a single process or jobs. If you want more advanced options such running a job with difference run controls for each process then you'll need to use a schedule jobset definition.
Schedule Jobset Definitions
A schedule jobset definition needs to run on a job. So the first step might be to create a job with one or more processes in it. For this example, i'm using the delivered All Process Types ALLTYPES PSJob. This runs a COBOL, a Crystal Report and a SQR report and is available through system process requests.
Once you have a job, navigate to the Schedule JobSet Definitions page (PeopleTools > Process Scheduler > Schedule Jobset Definitions) and select Add a New Value. For this example:
- The schedule name will be All Types Example
- The job name is ALLTYPES (and needs to exist first)
By default a new jobset definition has a status of inactive. You'll want to leave it inactive until you know it is working correctly - especially for more volatile processes. You'll need to also specify a run control ID. Note that this is user specific - the user that creates the schedule jobset is the one that the processes will be running under. For this reason, a lot of organisations create their own batch scheduling user (e.g. PSBATCH) for the specific purpose of running batch processes and jobs. All run controls, and schedule jobset definitions are then configured using that user. In this example, I'm just using the default run control ID which is my operator ID as this will always exist.
The next step is to set a begin date and time. This will be the date and time from which the job set will begin. You'll also need select your recurrence (daily for this example). You can also specify a process scheduler server if specifically required. However, it might be better to let PeopleTools decide what server to use. In this example, the ALLTYPES job includes a crystal report that will need to run on an NT server, however, the other processes should run on a Unix server.
Next, you'll need to specify schedule jobset items. This is effectively where you choose the run controls to be used by your job/processes. Use the left hand side tree view to expand your job (click on the icons) and then for each of the three processes, specify a run control ID (i'm using my operator ID). Note that these run control IDs need to already exist and be configured before you set them up in the job set items.
Also, for the ALLTYPES job, the crystal process (XRFAPFL) needs to have its server settings changed so that th server option is Specific Server and the server name is PSNT. This is because crystal reports can only run on Windows process schedulers servers.
The final tab, schedule jobset requests, is for informational purposes. It tells which requests have already been processed and when the next one is queued to run.
Before you set the jobset definition status to active, use the Run Now button to run the job set definition once to check it runs to success. Also note that when you save the schedule jobset definition, it may clear the recurrence name - this appears to be a bug?
Go to the process monitor and you should see the ALLTYPES job running, and hopefully it runs to success for you. Also, you should see the jobset definition calendar icon. Clicking on this icon tells gives you all the schedule jobset requests.
Note that your jobset definition may change status to completed. This indicates that the jobset has finished running and there are no more recurrences for it to process. The jobset will not run again with a status of completed. Change this back to active and ensure that your recurrence settings are correct.
In both examples, I've been using the Daily recurrence, which I believe is delivered with PeopleTools. However you might want to create your own recurrence with a different recurrence pattern, and request settings.
To do this, navigate to PeopleTools > Process Scheduler > Recurrences, add a new value and give it an informative name.
You'll need to choose between the options, schedule next recurrence when current request is initiated OR prior recurrence has completed. This essentially specifies whether to schedule the future recurrence before or after the current recurrence process request has completed. You can choose a regular recurrrence pattern, or use the customize dates option to specify one or more values in the run on specific dates grid. For example if you have a process that runs on two specific dates in a given calendar year, you can set them up this way.
The start and end request options are straightforward. The repeat is used to repeat a process within the recurrence pattern. For example if you might want your process to run every day, however, on each day you may also want it to run every 6 hours for the 24 hours of the day. That is, run 4 times each day (24 hours in day / repeat every 6 hours = 4 repeats).
The do not schedule processes missed from the recurrence pattern prevents the process scheduler from playing catch up if the start request date/time is before the current date/time. If you want processes to play catch up, then leave this unchecked, otherwise, set it to checked.
This article explains how to check for users who have set up their own recurrences. This can cause quite a problem if the user's profile is deleted but their recurrences are left in the system.