Task Scheduler

The Transaction Server task scheduler, or scheduler, can be set to start tasks at fixed times or at timed intervals each day. These tasks can perform services, such as back up a database, index a table, chime an alarm, or run a user-specified service. Any number of tasks can be set up in the scheduler. They can be set to run in either the foreground or background.

Additionally, the task scheduler can intercept events within the Transaction Server and post them to user written event handlers, where additional processing can be performed. The events can include cycle status change, entry, and trace unit of work state changes. As with scheduled tasks, any number of events can be set up in the scheduler and these events can run in either the foreground or the background.

Tasks can be configured to run periodically as recurring tasks, at one certain time, or manually upon request from the Control Center.

In addition to using the tasks that are shipped with Transaction Server, users can create their own tasks. A task is a Java™ program that extends com.ibm.icpcs.transactionserver.scheduler.ScheduledTask. The class can be found in the Transaction Server toolkit, txsvrtk.jar, found in the install_directory\shared\v328\pfs\ITS\SDK\java\lib\win directory. To invoke the task, use the task tag to register it in the scheduler XML file.

Each task must be implemented by the execute() method. If data needs to be initialized it is implemented by the init() method.

In the scheduler XML file, all tasks have a name, exec, timer, and an optional info specification.
name
This tag can be any user specified string and is used in the traces to identify the task. Each task must be given a different and unique name value.
exec
This tag must specify a valid task class name. A valid task class is one that extends com.ibm.icpcs.transactionserver.scheduler.ScheduledTask. To replace one of the default tasks, such as registering online or reporting directory maintenance with an implementation or to modify the timer settings, use the exact name specified above. For a complete list of task class names that have been implemented and are provided with the Transaction Server and for information about configuring tasks, see Tasks in the Transaction Server User's Guide.
timer
This tag is used to specify when the task is to be scheduled. For example, to indicate recurring tasks, specify the Type attribute as repeating. To specify a one-time task, set the type to single. The timer tag also has two more tags: interval and starting. The interval tag is required for a repeating timer and specifies the time interval between tasks.
info
This tag is optional and is useful if overriding a task that is configured by default. The information specified in this tag is presented during Transaction Server startup as the tasks are being enabled and can be used to uniquely identify the version of the task as the one being configured.