public void perform(ExecutionImpl execution) { NodeImpl destination = execution.getTransition().getDestination(); execution.setNode(destination); List<NodeImpl> enteredNodes = getNodesEntered(execution.getTransitionOrigin(), destination); ExecutionImpl propagatingExecution = execution; for (NodeImpl enteredNode : enteredNodes) { propagatingExecution = propagatingExecution.beginNode(enteredNode); } // Restore original transition source node // (so that the call to moveTo updates the previous node) propagatingExecution.setNode(execution.getTransitionOrigin()); propagatingExecution.moveTo(destination); propagatingExecution.performAtomicOperation(ExecutionImpl.EXECUTE_NODE); }
public boolean isAsync(ExecutionImpl execution) { return execution.getNode().isLeaveAsync() || execution.getTransition().isTakeAsync(); }
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 void moveTo(NodeImpl destination) { // if the parent node needs to know the previous node if (destination.isPreviousNeeded()) { setPreviousNode(getNode()); setPreviousTransition(getTransition()); } else { this.previousNode = null; this.previousTransition = null; } // move the execution to the destination node = destination; transition = null; transitionOrigin = null; }
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; }
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); } }
TransitionImpl transition = execution.getTransition(); log.trace("no current node. searching for transition from parent of "+transition); if (transition!=null) {