This topic applies only to the IBM Business Automation Workflow Advanced
configuration.

Suspending and resuming a task instance

Draft comment:
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15
You can suspend collaboration task instances (also known as human tasks in the API) or to-do task instances (also known as participating tasks in the API).

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.

About 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.

Procedure

  1. Get a list of tasks that are claimed by the logged-on user.
    FilterOptions fo = new FilterOptions();
    fo.setSelectedAttributes("TKIID");
    fo.setQueryCondition("STATE=STATE_CLAIMED");
    EntityResultSet result = task.queryEntities("TASK", fo, null, 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.getEntities().size() > 0)
    {
      Entity entity = (Entity) result.getEntities().get(0);
      TKIID tkiid = (TKIID) entity.getAttributeValue("TKIID");
      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.