One Time Tasks

One time tasks can be set up to execute at a specific date or time. They run at that exact moment and never run again. If a one time task is configured and the Transaction Server is started before the task is scheduled to run, the server waits for the allotted time and executes the task as expected. If the Transaction Server is started after the task date or time, the task is not executed.

The following example illustrates the configuration of a one time task:
<TASK background="yes">
   <NAME>25 Minute Afternoon Nap</NAME>
   <EXEC>
      com.ibm.icpcs.transactionserver.scheduler.ScheduledTaskSample
   </EXEC>
   <INFO>My one time task. 7-24-2020</INFO>
   <PARAMETER name="wait">25 mins</PARAMETER>
   <TIMER type="single">
      <STARTING>12:50 pm</STARTING>
   </TIMER>
</TASK>

Note that this task runs in the background, as specified. Notice the type="single" attribute specification on the <TIMER> tag. This is how a one time task is specified.

An additional tag, <PARAMETER...>, is specified. Several of the task classes can receive parameters that are specific to their operation. ScheduledTaskSample is such a task. It takes a single parameter named wait, which specifies a time interval for it to consume before ending the event. In this case, 25 minutes is used as the wait time. This is simply a test specification that allows a task to be kicked off in the background and use up 25 minutes of time. This functionality is why the task is named "25 Minute Afternoon Nap". For a complete list of valid task parameters, see Sample task class names.

Notice also the missing <INTERVAL> tag. One time tasks do not require an interval specification and ignore any that are specified. The <STARTING> tag, however, is a required tag for one time tasks and is specified exactly as described in Recurring Tasks.