Suspending and resuming a task instance

You can suspend human task instances or participating task instances and resume them again to complete them.

Before you begin

The task instance can be in the ready or claimed state. It can be escalated. The caller must be the owner, originator, or administrator of the task instance.

Why and when to perform this task

You can suspend a task instance while it is running. You might want to do this, for example, so that you can gather information that is needed to complete the task. When the information is available, you can resume the task instance.

Steps for this task

  1. Get a list of tasks that are claimed by the logged-on user.
    QueryResultSet result = task.query("DISTINCT TASK.TKIID",
                                       "TASK.STATE = TASK.STATE.STATE_CLAIMED",
                                       (String)null, 
                                       (Integer)null, 
                                       (TimeZone)null);

    This action returns a query result set that contains a list of the tasks that are claimed by the logged-on user.

  2. Suspend the task instance.
    if (result.size() > 0)
    {
      result.first();
      TKIID tkiid = (TKIID) result.getOID(1);
      task.suspend(tkiid);
    }

    This action suspends the specified task instance. The task instance is put into the suspended state.

  3. Resume the process instance.
    task.resume( tkiid );

    This action puts the task instance into the state it had before it was suspended.


Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)