/** @see Execution#takeDefaultTransition() */ public void take(Transition transition) { checkLock(); setPropagation(Propagation.EXPLICIT); setTransition((TransitionImpl) transition); // copy the current node as the transition origin. the origin can be different from // the transition source in case a transition is taken from an enclosing node setTransitionOrigin(getNode()); setPreviousTransition(null); performAtomicOperation(TAKE_TRANSITION); }
public void perform(ExecutionImpl execution) { if (execution.getName()!=null) { log.debug(execution.toString()+" signals "+node); } else { log.debug("signalling "+node+", signal="+signalName); } ExternalActivity externalActivity = (ExternalActivity) node.getBehaviour(); try { execution.setPropagation(Propagation.UNSPECIFIED); externalActivity.signal(execution, signalName, parameters); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new PvmException("couldn't signal "+node+": "+e.getMessage(), e); } if (execution.getPropagation() == Propagation.UNSPECIFIED) { execution.proceed(); } }
public void perform(ExecutionImpl execution) { NodeImpl node = execution.getNode(); if (log.isTraceEnabled()) { if (execution.getName()!=null) { log.trace(execution.toString()+" executes "+node); } else { log.trace("executing "+node); } } Activity activity = node.getBehaviour(); try { execution.setPropagation(Propagation.UNSPECIFIED); activity.execute(execution); } catch (Exception e) { execution.handleException(node, null, null, e, execution.toString()+" couldn't execute "+activity+" for node "+node); } if (execution.getPropagation()==Propagation.UNSPECIFIED) { execution.proceed(); } }
public ExecutionImpl createScope(CompositeElementImpl scope) { ExecutionImpl child = createExecution(scope.getName()); // copy the current state from the child execution to the parent execution child.setNode(getNode()); child.setTransition(getTransition()); child.setPropagation(getPropagation()); child.setTransitionOrigin(getTransitionOrigin()); child.setPreviousTransition(getPreviousTransition()); child.setPreviousNode(getPreviousNode()); child.initializeVariables(scope, this); child.initializeTimers(scope); return child; }
public ExecutionImpl destroyScope(CompositeElementImpl scope) { destroyTimers(scope); destroyVariables(scope, parent); // copy the current state from the child execution to the parent execution getParent().setNode(getNode()); getParent().setTransition(getTransition()); getParent().setPropagation(getPropagation()); getParent().setTransitionOrigin(getTransitionOrigin()); getParent().setPreviousTransition(getPreviousTransition()); getParent().setPreviousNode(getPreviousNode()); end(); parent.removeExecution(this); return parent; }