public Map<String, OpenExecution> getExecutionsMap() { if ( (executionsMap==null) && (executions!=null) ) { // initialize executionsMap cache executionsMap = new HashMap<String, OpenExecution>(); for(ExecutionImpl execution: executions) { String executionName = execution.getName(); // the next test makes sure that the first execution wins // in case there are multiple executions with the same name if (! executionsMap.containsKey(executionName)) { executionsMap.put(executionName, execution); } } } return executionsMap; }
tok.setName(execution.getName()); tok.setId(executionId);
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 void perform(ExecutionImpl execution) { TransitionImpl transition = execution.getTransition(); if (execution.getName()!=null) { log.debug(execution.toString()+" takes "+transition); } else { log.debug("taking "+transition); } List<NodeImpl> leftNodes = getNodesLeft(execution.getNode(), transition.getDestination()); ExecutionImpl propagatingExecution = execution; for (NodeImpl leftNode : leftNodes) { propagatingExecution = propagatingExecution.endNode(leftNode); } propagatingExecution.setNode(null); propagatingExecution.fire(Event.TRANSITION_TAKE, transition); boolean wait = false; Condition waitCondition = transition.getWaitCondition(); if (waitCondition!=null) { wait = waitCondition.evaluate(propagatingExecution); } if (!wait) { propagatingExecution.performAtomicOperation(ExecutionImpl.PROCEED_TO_DESTINATION); } }