Analyzing the results of a task

A participating or purely human task runs asynchronously. If a reply handler is specified when the task starts, the output message is automatically returned when the task completes. If a reply handler is not specified, the message must be retrieved explicitly.

Why and when to perform this task

The results of the task are stored in the database only if the task template from which the task instance was derived does not specify automatic deletion of the derived task instances.

Steps for this task

Analyze the results of the task.

The example shows how to check the order number of a successfully completed task.

QueryResultSet result = task.query("DISTINCT TASK.TKIID", 
                                   "TASK.NAME = 'CustomerOrder' AND 
                                    TASK.STATE = TASK.STATE.STATE_FINISHED", 
                                    (String)null, (Integer)null, (TimeZone)null);
if (result.size() > 0)
{
  result.first();
  TKIID tkiid = (TKIID) result.getOID(1);
  ClientObjectWrapper output = task.getOutputMessage(tkiid);
  DataObject myOutput = null;
  if ( output.getObject() != null && output.getObject() instanceof DataObject)
  {
     myOutput  = (DataObject)output.getObject();
     int order = myOutput.getInt("OrderNo");
  }
}
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)