+

Search Tips   |   Advanced Search

Manage the scheduler

Use administrative commands to manage scheduled tasks in Activities.

Activities uses the WAS scheduling service for performing regular managed tasks. For more information about how the scheduler works, see Scheduling tasks.

To manage a task:

  1. Start the Activities Jython script interpreter.

      ./wsadmin.sh -lang jython
      execfile("activitiesAdmin.py")

  2. Administer the Activities scheduler service.

    ActivitiesScheduler.getTaskDetails(java.lang.String taskName)

    Return information about the scheduled task specified by taskName. Jobs include:

    • "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 the task is not scheduled to run.

    For example:

      ActivitiesScheduler.getTaskDetails("TrashAutoPurgeJob")

    The resulting output looks similar to the following:

      {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 pause 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. 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:

      ActivitiesScheduler.pauseSchedulingTask("TrashAutoPurgeJob")

    When a task is paused, a status message similar to the following is written to SystemOut.log:

      [2/10/10 15:28:26:354 EST] 00000659 ActivitiesNot I CLFWY0134I: Activities scheduled task 'TrashAutoPurgeJob' fired event 'TaskNotificationInfo.SUSPENDED'

    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.

    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:

      ActivitiesScheduler.resumeSchedulingTask("TrashAutoPurgeJob")

    Resuming a paused task causes the following status message to be written to SystemOut.log:

      [2/10/10 15:49:12:198 EST] 00000633 ActivitiesNot I CLFWY0134I: Activities scheduled task 'TrashAutoPurgeJob' fired event 'TaskNotificationInfo.RESUMED'

    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.


Parent topic:
Administer Activities


Related:
Start the wsadmin client
Complete activities that are not being used
Scheduling Activities statistics collection
Empty the Activities trash on a schedule