public boolean isAsync(PvmExecutionImpl execution) {
return execution.getActivity().isAsyncAfter();
}
public void execute(PvmExecutionImpl execution) {
TransitionImpl transition = execution.getTransition();
// while executing the transition, the activityInstance is 'null'
// (we are not executing an activity)
execution.setActivityInstanceId(null);
List<DelegateListener<? extends BaseDelegateExecution>> executionListeners = transition.getListeners(ExecutionListener.EVENTNAME_TAKE);
int executionListenerIndex = execution.getListenerIndex();
if (executionListeners.size()>executionListenerIndex) {
execution.setEventName(ExecutionListener.EVENTNAME_TAKE);
execution.setEventSource(transition);
DelegateListener<? extends BaseDelegateExecution> listener = executionListeners.get(executionListenerIndex);
try {
execution.invokeListener(listener);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new PvmException("couldn't execute event listener : "+e.getMessage(), e);
}
execution.setListenerIndex(executionListenerIndex + 1);
execution.performOperationSync(this);
} else {
log.fine(execution+" takes transition "+transition);
execution.setListenerIndex(0);
execution.setEventName(null);
execution.setEventSource(null);
ActivityImpl activity = execution.getActivity();
ActivityImpl nextScope = findNextScope(activity.getFlowScope(), transition.getDestination());
execution.setActivity(nextScope);
if (nextScope.isCancelScope()) {
execution.performOperation(TRANSITION_CANCEL_SCOPE);
} else {