Managing the scheduler
Use administrative commands to manage scheduled tasks in Activities.
Before you begin
To run administrative commands, you must use the wsadmin client. See Starting the wsadmin client for details.
About this task
To manage a task, complete the following steps:
Procedure
- Start the Activities Jython script interpreter.
- Use the following commands to administer the Activities
scheduler service.
- ActivitiesScheduler.getTaskDetails(java.lang.String taskName)
- Returns information about the scheduled task specified by taskName.
Specify one of the following jobs:
- "30MinStats"
- "ActivityAutoCompleteJob"
- "DailyStats"
- "DatabaseRuntimeStats"
- "TrashAutoPurgeJob"
- "EventLogPurgeJob"
The values returned are server time, next scheduled run time, status (SCHEDULED, RUNNING, SUSPENDED), and task name. When the task has been paused, then the status parameter shows as SUSPENDED instead of SCHEDULED. SUSPENDED means that the task is not scheduled to run.
For example:
The resulting output looks similar to the following:ActivitiesScheduler.getTaskDetails("TrashAutoPurgeJob")
{currentServerTime=Fri Jan 22 14:13:52 EST 2010, nextFireTime= Fri Jan 22 14:21:00 EST 2010, status=SCHEDULED, taskName=TrashAutoPurgeJob}
- ActivitiesScheduler.pauseSchedulingTask(java.lang.String taskName)
- Temporarily pauses the specified task and stops it from running.
When you pause a scheduled task, the task remains in the suspended state even after you stop and restart Activities or the IBM® WebSphere® Application Server. You must run the ActivitiesScheduler.resumeSchedulingTask(String taskName) command to get the task running again.
If the task is currently running, it continues to run but is not scheduled to run again. If the task is already suspended, this command has no effect.
For example:
When a task is paused, a status message similar to the following is written to the SystemOut.log file:ActivitiesScheduler.pauseSchedulingTask("TrashAutoPurgeJob")
When the task is paused successfully, a 1 is returned to the wsadmin client. When the task is not paused successfully, a 0 is returned.[2/10/10 15:28:26:354 EST] 00000659 ActivitiesNot I CLFWY0134I: Activities scheduled task 'TrashAutoPurgeJob' fired event 'TaskNotificationInfo.SUSPENDED'
- ActivitiesScheduler.resumeSchedulingTask(java.lang.String taskName)
- If the task is suspended, puts the task in the scheduled state.
If the task is not suspended, this command has no effect.
When a task is resumed, it does not run immediately; it runs at the time when it is next scheduled to run.
For example:
Resuming a paused task causes the following status message to be written to the SystemOut.log file:ActivitiesScheduler.resumeSchedulingTask("TrashAutoPurgeJob")
When the task is resumed successfully, a 1 is returned to the wsadmin client. When the task is not resumed successfully, a 0 is returned.[2/10/10 15:49:12:198 EST] 00000633 ActivitiesNot I CLFWY0134I: Activities scheduled task 'TrashAutoPurgeJob' fired event 'TaskNotificationInfo.RESUMED'