Coverage Report - org.kuali.rice.kew.engine.RouteHelper
 
Classes in this File Line Coverage Branch Coverage Complexity
RouteHelper
0%
0/13
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  *
 4  
  *
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.engine;
 18  
 
 19  
 import org.kuali.rice.core.reflect.ObjectDefinition;
 20  
 import org.kuali.rice.core.resourceloader.GlobalResourceLoader;
 21  
 import org.kuali.rice.core.util.ClassLoaderUtils;
 22  
 import org.kuali.rice.kew.engine.node.BasicJoinEngine;
 23  
 import org.kuali.rice.kew.engine.node.DynamicNode;
 24  
 import org.kuali.rice.kew.engine.node.JoinEngine;
 25  
 import org.kuali.rice.kew.engine.node.JoinNode;
 26  
 import org.kuali.rice.kew.engine.node.Node;
 27  
 import org.kuali.rice.kew.engine.node.RequestActivationNode;
 28  
 import org.kuali.rice.kew.engine.node.RequestsNode;
 29  
 import org.kuali.rice.kew.engine.node.RouteNode;
 30  
 import org.kuali.rice.kew.engine.node.SimpleNode;
 31  
 import org.kuali.rice.kew.engine.node.SplitNode;
 32  
 import org.kuali.rice.kew.engine.node.SubProcessNode;
 33  
 
 34  
 
 35  
 /**
 36  
  * A helper class which provides some useful utilities for examining and generating nodes.
 37  
  * Provides access to the {@link JoinEngine} and the {@link RoutingNodeFactory}.
 38  
  *
 39  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 40  
  */
 41  0
 public class RouteHelper {
 42  
 
 43  0
     private JoinEngine joinEngine = new BasicJoinEngine();
 44  0
     private RoutingNodeFactory nodeFactory = new RoutingNodeFactory();
 45  
 
 46  
     public JoinEngine getJoinEngine() {
 47  0
         return joinEngine;
 48  
     }
 49  
 
 50  
     public RoutingNodeFactory getNodeFactory() {
 51  0
         return nodeFactory;
 52  
     }
 53  
 
 54  
     public boolean isSimpleNode(RouteNode routeNode) {
 55  0
         return ClassLoaderUtils.isInstanceOf(getNode(routeNode), SimpleNode.class);
 56  
     }
 57  
 
 58  
     public boolean isJoinNode(RouteNode routeNode) {
 59  0
         return ClassLoaderUtils.isInstanceOf(getNode(routeNode), JoinNode.class);
 60  
     }
 61  
 
 62  
     public boolean isSplitNode(RouteNode routeNode) {
 63  0
         return ClassLoaderUtils.isInstanceOf(getNode(routeNode), SplitNode.class);
 64  
     }
 65  
 
 66  
     public boolean isDynamicNode(RouteNode routeNode) {
 67  0
         return ClassLoaderUtils.isInstanceOf(getNode(routeNode), DynamicNode.class);
 68  
     }
 69  
 
 70  
     public boolean isSubProcessNode(RouteNode routeNode) {
 71  0
         return ClassLoaderUtils.isInstanceOf(getNode(routeNode), SubProcessNode.class);
 72  
     }
 73  
 
 74  
     public boolean isRequestActivationNode(RouteNode routeNode) {
 75  0
         return ClassLoaderUtils.isInstanceOf(getNode(routeNode), RequestActivationNode.class);
 76  
     }
 77  
 
 78  
     public boolean isRequestsNode(RouteNode routeNode) {
 79  0
         return getNode(routeNode) instanceof RequestsNode;
 80  
     }
 81  
 
 82  
     public Node getNode(RouteNode routeNode) {
 83  0
             return (Node)GlobalResourceLoader.getObject(new ObjectDefinition(routeNode.getNodeType(), routeNode.getDocumentType().getServiceNamespace()));
 84  
     }
 85  
 }