public boolean equals(Object arg0, Object arg1) throws HibernateException { if ( (arg0==null) || (arg1==null)) return false; ExecutionImpl execution0 = (ExecutionImpl) arg0; ExecutionImpl execution1 = (ExecutionImpl) arg1; String nodeName0 = execution0.getNode().getName(); String nodeName1 = execution1.getNode().getName(); return nodeName0.equals(nodeName1); }
public boolean isAsync(ExecutionImpl execution) { return execution.getNode().isSignalAsync(); }
public boolean isAsync(ExecutionImpl execution) { return execution.getNode().isExecutionAsync(); }
public void nullSafeSet(PreparedStatement st, Object owner, int index) throws HibernateException, SQLException { if (owner!=null) { ExecutionImpl execution = (ExecutionImpl) owner; String nodeName = execution.getNode().getName(); log.trace("binding 'execution-state{"+nodeName+"}' to parameter: "+index); st.setString(index, nodeName); } }
public boolean isAsync(ExecutionImpl execution) { return execution.getNode().isLeaveAsync() || execution.getTransition().isTakeAsync(); }
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 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; }
/** @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) { 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 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 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); } }
ObservableElement eventSource = execution.getNode(); if (log.isDebugEnabled()) log.debug("firing event "+signalName+" into "+eventSource); execution.fire(eventName, eventSource);
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; }