Analyzing the results of a process

A process can expose Web services operations that are modeled as Web Services Description Language (WSDL) one-way or request-response operations. If a long-running process exposes a one-way operation, the results of the process, such as the values of process variables, must be retrieved from the database.

Why and when to perform this task

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", 
                         (String)null, (Integer)null, (TimeZone)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

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