Terminating a task instance

Sometimes it is necessary for someone with administrator rights to terminate a task instance that is known to be in an unrecoverable state. Because the task instance is terminated immediately, you should terminate a task instance only in exceptional situations.

Procedure

  1. Retrieve the task instance to be terminated.
    Task taskInstance = task.getTask(tkiid);
  2. Terminate the task instance.
    TKIID tkiid = taskInstance.getID();
    task.terminate(tkiid);

    The task instance is terminated immediately without waiting for any outstanding tasks.