1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.engine.transition;
17
18 import org.kuali.rice.kew.api.exception.WorkflowException;
19 import org.kuali.rice.kew.engine.RouteHelper;
20 import org.kuali.rice.kew.engine.node.RouteNode;
21 import org.kuali.rice.kew.engine.node.RouteNodeInstance;
22
23
24
25
26
27
28
29
30
31 public class TransitionEngineFactory {
32
33 public static TransitionEngine createTransitionEngine(RouteNodeInstance nodeInstance) throws Exception {
34 RouteHelper helper = new RouteHelper();
35 RouteNode routeNode = nodeInstance.getRouteNode();
36 TransitionEngine engine = null;
37 if (helper.isSimpleNode(routeNode)) {
38 engine = new SimpleTransitionEngine();
39 } else if (helper.isSplitNode(routeNode)) {
40 engine = new SplitTransitionEngine();
41 } else if (helper.isJoinNode(routeNode)) {
42 engine = new JoinTransitionEngine();
43 } else if (helper.isDynamicNode(routeNode)) {
44 engine = new DynamicTransitionEngine();
45 } else if (helper.isSubProcessNode(routeNode)) {
46 engine = new SubProcessTransitionEngine();
47 } else {
48 throw new WorkflowException("Could not locate transition engine for node " + routeNode.getNodeType());
49 }
50 engine.setRouteHelper(helper);
51 return engine;
52 }
53
54 }