public void move(Node destination) { checkLock(); setNode((NodeImpl) destination); }
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException { ExecutionImpl execution = createExecution(owner); String nodeName = rs.getString(names[0]); NodeImpl node = (NodeImpl) execution.getProcessDefinition().getNode(nodeName); execution.setNode(node); execution.setState(Execution.STATE_ACTIVE); return execution; }
protected ExecutionImpl initializeScopes() { LinkedList<NodeImpl> enteredNodes = new LinkedList<NodeImpl>(); NodeImpl initial = processDefinition.getInitial(); ExecutionImpl scopedExecution = null; if (initial!=null) { enteredNodes.add(initial); NodeImpl parentNode = initial.getParentNode(); while (parentNode!=null) { enteredNodes.addFirst(parentNode); parentNode = parentNode.getParentNode(); } scopedExecution = this; initializeVariables(processDefinition, this); initializeTimers(processDefinition); for (NodeImpl enteredNode: enteredNodes) { if (enteredNode.isLocalScope()) { scopedExecution.setNode(enteredNode); scopedExecution = scopedExecution.createScope(enteredNode); } } scopedExecution.setNode(initial); } return scopedExecution; }
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 Object deepCopy(Object object) throws HibernateException { if (object==null) { return null; } ExecutionImpl original = (ExecutionImpl) object; NodeImpl node = new NodeImpl(); node.setName(original.getNode().getName()); ExecutionImpl copy = new ExecutionImpl(); copy.setNode(node); return copy; }
public void perform(ExecutionImpl execution) { NodeImpl node = execution.getNode(); NodeImpl parentNode = node.getParentNode(); ExecutionImpl propagatingExecution = execution.endNode(node); // Restore original source node // (so that the call to moveTo updates the previous node) propagatingExecution.setNode(node); propagatingExecution.moveTo(parentNode); propagatingExecution.performAtomicOperation(new Signal(null, null, parentNode)); }
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 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); } }
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; }