/** * Test whether a process state is one of the completed states, e.g., * {@link #STATE_COMPLETED_OK} or {@link #STATE_COMPLETED_WITH_FAULT}. * * @param state the state of the process * @return <code>true</code> if the process is finished. */ public static boolean isFinished(short state){ return !(canExecute(state) || state == STATE_SUSPENDED); } /**
boolean canReduce = true; assert _outstandingRequests == null && _imaManager != null; while (ProcessState.canExecute(_dao.getState()) && System.currentTimeMillis() < maxTime && canReduce) { canReduce = _vpu.execute(); if (!ProcessState.isFinished(_dao.getState())) { if (__log.isDebugEnabled()) __log.debug("Setting execution state on instance " + _iid); _soup.setGlobalData(_imaManager); if (ProcessState.canExecute(_dao.getState()) && canReduce) {
/** * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#finishCompletion() */ public void finishCompletion() { // make sure we have completed. assert (ProcessState.isFinished(this.getState())); // let our process know that we've done our work. this.getProcess().instanceCompleted(this); }
/** * @see org.apache.ode.bpel.dao.ProcessInstanceDAO#finishCompletion() */ public void finishCompletion() { entering("ProcessInstanceDaoImpl.finishCompletion"); // make sure we have completed. assert (ProcessState.isFinished(this.getState())); // let our process know that we've done our work. this.getProcess().instanceCompleted(this); }
protected void timerEvent(final String timerResponseChannel) { // In case this is a pick event, we remove routes, // and cancel the outstanding requests. _dao.getProcess().removeRoutes(timerResponseChannel, _dao); _imaManager.cancel(timerResponseChannel, true); // Ignore timer events after the process is finished. if (ProcessState.isFinished(_dao.getState())) { return; } _vpu.inject(new JacobRunnable() { private static final long serialVersionUID = -7767141033611036745L; public void run() { TimerResponseChannel responseChannel = importChannel(timerResponseChannel, TimerResponseChannel.class); responseChannel.onTimeout(); } }); execute(); }
ProcessDAO process = _db.getProcessDAO(); ProcessInstanceDAO instance = process.getInstance(evt.getProcessInstanceId()); if(ProcessState.canExecute(instance.getState())){