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.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 | |
|
37 | |
|
38 | |
|
39 | |
|
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 | |
} |