public Node getNode() { return token.getNode(); }
public Node getNode() { return token.getNode(); }
protected Collection getTransitionNames(Token token) { Node node = token.getNode(); return node.getLeavingTransitionsMap().keySet(); }
protected Collection getTransitionNames(Token token) { Node node = token.getNode(); return node.getLeavingTransitionsMap().keySet(); }
public void notifyListeners() { if (listeners != null) { // for every token that was waiting for this milestone for (Iterator iter = listeners.iterator(); iter.hasNext();) { Token token = (Token) iter.next(); // leave the milestone node Node node = token.getNode(); ExecutionContext executionContext = new ExecutionContext(token); node.leave(executionContext); } } }
public void notifyListeners() { if (listeners != null) { // for every token that was waiting for this milestone for (Iterator iter = listeners.iterator(); iter.hasNext();) { Token token = (Token) iter.next(); // leave the milestone node Node node = token.getNode(); ExecutionContext executionContext = new ExecutionContext(token); node.leave(executionContext); } } }
/** * Get the current Node of the pageflow. */ public Node getNode() { if (processInstance==null) return null; Node node = getSubProcessInstance().getRootToken().getNode(); if (node==null) { throw new IllegalStateException("pageflow has not yet started"); } return node; }
protected void retrieveToken(Token token) { retrieveNode(token.getNode()); // Hibernate.initialize(token.getAvailableTransitions()); for (Iterator iter = token.getChildren().values().iterator(); iter.hasNext();) { retrieveToken((Token) iter.next()); } }
public boolean isStarted() { return getSubProcessInstance().getRootToken().getNode() != null; }
protected void retrieveToken(Token token) { retrieveNode(token.getNode()); // Hibernate.initialize(token.getAvailableTransitions()); if( token.getChildren() != null ) { for (Iterator iter = token.getChildren().values().iterator(); iter.hasNext();) { retrieveToken((Token) iter.next()); } } }
private void changeTokenVersion(Token token) { // change node reference on token (current node) Node oldNode = token.getNode(); ProcessDefinition newDef = token.getProcessInstance().getProcessDefinition(); Node newNode = findReplacementNode(newDef, oldNode); token.setNode(newNode); // Change timers too! adjustTimersForToken(token); // change tasks adjustTaskInstancesForToken(token); // change children recursively Map children = token.getChildren(); if (children != null) { for (Iterator i = children.values().iterator(); i.hasNext();) { changeTokenVersion((Token) i.next()); } } }
public void execute(ExecutionContext executionContext) { Token token = executionContext.getToken(); Collection transitionNames = retrieveTransitionNames(token); // if this is the first time we enter if ( transitionNames == null ) { // collect all leaving transition names transitionNames = new ArrayList(getTransitionNames(token)); } // select one of the remaining transition names String nextTransition = interleaver.selectNextTransition(transitionNames); // remove it from the remaining transitions transitionNames.remove(nextTransition); // store the transition names storeTransitionNames(transitionNames,token); // pass the token over the selected transition token.getNode().leave(executionContext, nextTransition); }
public void execute(ExecutionContext executionContext) { Token token = executionContext.getToken(); Collection transitionNames = retrieveTransitionNames(token); // if this is the first time we enter if ( transitionNames == null ) { // collect all leaving transition names transitionNames = new ArrayList(getTransitionNames(token)); } // select one of the remaining transition names String nextTransition = interleaver.selectNextTransition(transitionNames); // remove it from the remaining transitions transitionNames.remove(nextTransition); // store the transition names storeTransitionNames(transitionNames,token); // pass the token over the selected transition token.getNode().leave(executionContext, nextTransition); }
private void changeTokenVersion(Token token) { // change node reference on token (current node) Node oldNode = token.getNode(); ProcessDefinition newDef = token.getProcessInstance().getProcessDefinition(); Node newNode = findReplacementNode(newDef, oldNode); token.setNode(newNode); // Change timers too! adjustTimersForToken(token); // change tasks adjustTaskInstancesForToken(token); // change children recursively Map children = token.getChildren(); if (children != null) { for (Iterator i = children.values().iterator(); i.hasNext();) { changeTokenVersion((Token) i.next()); } } }
public void execute(ExecutionContext executionContext) { Token token = executionContext.getToken(); // get the token on which the milestone should be verified Token milestoneToken = token.findToken( tokenPath ); if ( isMilestoneReached( name, milestoneToken ) ) { // continue to pass the token over the default transition token.getNode().leave(executionContext); } else { addMilestoneListener(name,milestoneToken); } }
public void execute(ExecutionContext executionContext) { Token token = executionContext.getToken(); // get the token on which the milestone should be verified Token milestoneToken = token.findToken( tokenPath ); if ( isMilestoneReached( name, milestoneToken ) ) { // continue to pass the token over the default transition token.getNode().leave(executionContext); } else { addMilestoneListener(name,milestoneToken); } }
public boolean execute(JbpmContext jbpmContext) throws Exception { Token token = getToken(); ExecutionContext executionContext = new ExecutionContext(token); executionContext.setAction(action); executionContext.setEvent(action.getEvent()); Node node; if (token != null && (node = token.getNode()) != null) { node.executeAction(action, executionContext); } else { action.execute(executionContext); } return true; }
public boolean execute(JbpmContext jbpmContext) throws Exception { Token token = getToken(); ExecutionContext executionContext = new ExecutionContext(token); executionContext.setAction(action); executionContext.setEvent(action.getEvent()); Node node; if (token != null && (node = token.getNode()) != null) { node.executeAction(action, executionContext); } else { action.execute(executionContext); } return true; }
/** * creates a child token. */ public Token(Token parent, String name) { this.start = Clock.getCurrentTime(); this.processInstance = parent.getProcessInstance(); this.name = name; this.node = parent.getNode(); this.parent = parent; parent.addChild(this); this.isTerminationImplicit = parent.isTerminationImplicit(); parent.addLog(new TokenCreateLog(this)); // assign an id to this token before events get fired Services.assignId(this); }
/** * creates a child token. */ public Token(Token parent, String name) { this.start = Clock.getCurrentTime(); this.processInstance = parent.getProcessInstance(); this.name = name; this.node = parent.getNode(); this.parent = parent; parent.addChild(this); this.isTerminationImplicit = parent.isTerminationImplicit(); parent.addLog(new TokenCreateLog(this)); // assign an id to this token before events get fired Services.assignId(this); }