Analyzing the results of a process

Why and when to perform this task

A long-running process runs asynchronously. Its output message is not automatically returned when the process completes. The message must be retrieved explicitly. The results of the process are stored in the database only if the process template from which the process instance was derived does not specify automatic deletion of the derived process instances.

Steps for this task

Analyze the results of the process, for example, check the order number.
QueryResultSet result = process.query
                       ("PROCESS_INSTANCE.PIID", 
                        "PROCESS_INSTANCE.NAME = 'CustomerOrder' AND 
                         PROCESS_INSTANCE.STATE = 
                                 PROCESS_INSTANCE.STATE.STATE_FINISHED", 
                         null, null, null);
if (result.size() > 0)
{
  result.first();
  PIID piid = (PIID) result.getOID(1);
  ClientObjectWrapper output = process.getOutputMessage(piid);
  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: Thu Apr 27 14:54:58 2006

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