Deleting task instances

Task instances are only automatically deleted when they complete if this is specified in the associated task template from which the instances are derived. This example shows how to delete all of the task instances that are finished and are not automatically deleted.

Steps for this task

  1. List the task instances that are finished.
    QueryResultSet result = 
         task.query("DISTINCT TASK.TKIID",
                    "TASK.STATE = TASK.STATE.STATE_FINISHED", 
                     (String)null, (Integer)null, (TimeZone)null);
    This action returns a query result set that lists task instances that are finished.
  2. Delete the task instances that are finished.
    while (result.next() )
    {
    	TKIID tkiid = (TKIID) result.getOID(1);
    	task.delete(tkiid);
    }
Related concepts
Queries on business-process and task-related objects

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