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
QueryResultSet result = process.query("DISTINCT ACTIVITY.AIID", "ACTIVITY.STATE = ACTIVITY.STATE.STATE_STOPPED AND PROCESS_INSTANCE.NAME='CustomerOrder'", null, null, null);
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
.