Analyzing the results of a task

Why and when to perform this 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.

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", 
                                    null, null, 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

Terms of use |

Last updated: Tue Feb 21 17:31:28 2006

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