Checking which fault is set for an activity

Steps for this task

  1. List the task activities that are in a failed or stopped state.
    QueryResultSet result = 
         process.query("ACTIVITY.AIID", 
                       "(ACTIVITY.STATE = ACTIVITY.STATE.STATE_FAILED OR 
                         ACTIVITY.STATE = ACTIVITY.STATE.STATE_STOPPED) AND 
                         ACTIVITY.KIND=ACTIVITY.KIND.KIND_STAFF",
                         null, null, null); 
    This action returns a query result set that contains failed or stopped activities.
  2. Read the name of the fault.

    This fault name is the local part of the fault queue name.

    if (result.size() > 0)
    {
      result.first();
      AIID aiid = (AIID) result.getOID(1);
      ClientObjectWrapper faultMessage = process.getFaultMessage(aiid);
      DataObject fault = null ;
      if ( faultMessage.getObject() != null && faultMessage.getObject() 
           instanceof DataObject )
      {
        fault = (DataObject)faultMessage.getObject();
        Type type = fault.getType();
        String name = type.getName();
        String uri = type.getURI();
      }
    }

    This returns the fault name. You can also analyze the unhandled exception for a stopped activity instead of retrieving the fault name.


Terms of use | | Broken links

Last updated: Tue Feb 21 17:21:51 2006

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