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 run services, such as backing 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 more processing can be done. 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 provided 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 software development toolkit file, txsvrtk.jar. This file is located in the install_directory\shared\v3213\pfs\ITS\SDK\java\lib\win directory.

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

To run the task, use the task tag to register it in the scheduler XML file. 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 that is specified above. For a complete list of task class names that are implemented and provided with the Transaction Server and for information about configuring tasks, see Configuring the scheduler.
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 you are overriding a task that is configured by default. The information that is specified in this tag is presented during Transaction Server startup as the tasks are being enabled. It can be used to uniquely identify the version of the task as the one that is being configured.