Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.kuali.rice.kew.engine.transition;
Common superclass for all Transition Engines. A TransitionEngine handles transitioning into and out of a org.kuali.rice.kew.engine.node.RouteNodeInstance. The TransitionEngine is also responsible for determining if a Node has completed.

Kuali Rice Team (
public abstract class TransitionEngine {
	private RouteHelper helper;
	public RouteNodeInstance transitionTo(RouteNodeInstance nextNodeInstanceRouteContext contextthrows Exception {
		return nextNodeInstance;
Tell the WorkflowEngine processing the activeNodeInstance if the node is complete and transitionFrom can be called.

context for routing
    public abstract ProcessResult isComplete(RouteContext contextthrows Exception;
    public Transition transitionFrom(RouteContext contextProcessResult processResultthrows Exception {
        return new Transition(resolveNextNodeInstances(context.getNodeInstance()));
    protected void setRouteHelper(RouteHelper helper) {
    	this. = helper;
    protected RouteHelper getRouteHelper() {
    	return ;
    protected Node getNode(RouteNode routeNodeClass nodeClassthrows Exception {
		return .getNode(routeNode);
Determines the next nodes instances for the transition. If the node instance already has next nodes instances (i.e. a dynamic node), then those will be returned. Otherwise it will resolve the next nodes from the RouteNode prototype.

nodeInstance for the transition
nextRouteNodes list of route notes
list of route note instances
    protected List<RouteNodeInstanceresolveNextNodeInstances(RouteNodeInstance nodeInstanceList<RouteNodenextRouteNodes) {
        List<RouteNodeInstancenextNodeInstances = new ArrayList<RouteNodeInstance>();
        for (RouteNode nextRouteNode : nextRouteNodes)
            RouteNode nextNode = (RouteNodenextRouteNode;
            RouteNodeInstance nextNodeInstance = getRouteHelper().getNodeFactory().createRouteNodeInstance(nodeInstance.getDocumentId(), nextNode);
        return nextNodeInstances;
        return resolveNextNodeInstances(nodeInstancenodeInstance.getRouteNode().getNextNodes());
New to GrepCode? Check out our FAQ X