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