Forcing the completion of an activity

Why and when to perform this task

If an activity in an interruptible process encounters a system exception or an unconnected fault terminal and the associated activity template specifies that the activity stops when an error occurs, the activity is put into the stopped state so that it can be repaired. In this state, you can force the completion of the activity. You can also pass parameters in the force-complete call, such as the message that should have been computed or the fault that should have been raised.

Steps for this task

  1. List the stopped activities.
    QueryResultSet result = 
         process.query("DISTINCT ACTIVITY.AIID",
                       "ACTIVITY.STATE = ACTIVITY.STATE.STATE_STOPPED AND 
                        PROCESS_INSTANCE.NAME='CustomerOrder'",
                        null, null, null);
    
    This action returns the stopped activities for the CustomerOrder process instance.
  2. Complete the activity.
    In this example, an output message is passed:
    if (result.size() > 0)
    {
    	result.first();
    	AIID aiid = (AIID) result.getOID(1);
    	OrderNo output = new OrderNo(4711);
    	process.forceComplete(aiid, new ClientObjectWrapper(output), true);
    }

    For more information, see the Javadoc

    .
    The activity is complete. If a system error occurs, the continueOnError parameter determines whether the activity stays in the stopped state. In the example, continueOnError=true. This value means that if an error occurs during processing of the forceComplete request, the activity is put into the failed execution state. Navigation continues and the process is put into the failing state.

Related concepts
Queries on business-process objects in V5.0-style processes
Related tasks
Retrying the execution of a stopped activity



Searchable topic ID:   t6admfce
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/wfapi/tasks/t6admfce.html

Library | Support | Terms of Use | Feedback