1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.kew.engine;
18
19 import org.kuali.rice.core.api.reflect.ObjectDefinition;
20 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
21 import org.kuali.rice.core.api.reflect.ObjectDefinition;
22 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
23 import org.kuali.rice.core.util.ClassLoaderUtils;
24 import org.kuali.rice.kew.engine.node.BasicJoinEngine;
25 import org.kuali.rice.kew.engine.node.DynamicNode;
26 import org.kuali.rice.kew.engine.node.JoinEngine;
27 import org.kuali.rice.kew.engine.node.JoinNode;
28 import org.kuali.rice.kew.engine.node.Node;
29 import org.kuali.rice.kew.engine.node.RequestActivationNode;
30 import org.kuali.rice.kew.engine.node.RequestsNode;
31 import org.kuali.rice.kew.engine.node.RouteNode;
32 import org.kuali.rice.kew.engine.node.SimpleNode;
33 import org.kuali.rice.kew.engine.node.SplitNode;
34 import org.kuali.rice.kew.engine.node.SubProcessNode;
35
36
37
38
39
40
41
42
43 public class RouteHelper {
44
45 private JoinEngine joinEngine = new BasicJoinEngine();
46 private RoutingNodeFactory nodeFactory = new RoutingNodeFactory();
47
48 public JoinEngine getJoinEngine() {
49 return joinEngine;
50 }
51
52 public RoutingNodeFactory getNodeFactory() {
53 return nodeFactory;
54 }
55
56 public boolean isSimpleNode(RouteNode routeNode) {
57 return ClassLoaderUtils.isInstanceOf(getNode(routeNode), SimpleNode.class);
58 }
59
60 public boolean isJoinNode(RouteNode routeNode) {
61 return ClassLoaderUtils.isInstanceOf(getNode(routeNode), JoinNode.class);
62 }
63
64 public boolean isSplitNode(RouteNode routeNode) {
65 return ClassLoaderUtils.isInstanceOf(getNode(routeNode), SplitNode.class);
66 }
67
68 public boolean isDynamicNode(RouteNode routeNode) {
69 return ClassLoaderUtils.isInstanceOf(getNode(routeNode), DynamicNode.class);
70 }
71
72 public boolean isSubProcessNode(RouteNode routeNode) {
73 return ClassLoaderUtils.isInstanceOf(getNode(routeNode), SubProcessNode.class);
74 }
75
76 public boolean isRequestActivationNode(RouteNode routeNode) {
77 return ClassLoaderUtils.isInstanceOf(getNode(routeNode), RequestActivationNode.class);
78 }
79
80 public boolean isRequestsNode(RouteNode routeNode) {
81 return getNode(routeNode) instanceof RequestsNode;
82 }
83
84 public Node getNode(RouteNode routeNode) {
85 return (Node) GlobalResourceLoader.getObject(new ObjectDefinition(routeNode.getNodeType(), routeNode.getDocumentType().getApplicationId()));
86 }
87 }