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.kew.engine.node.Branch; |
20 | |
import org.kuali.rice.kew.engine.node.RouteNode; |
21 | |
import org.kuali.rice.kew.engine.node.RouteNodeInstance; |
22 | |
import org.kuali.rice.kew.service.KEWServiceLocator; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | 5 | public class RoutingNodeFactory { |
31 | |
|
32 | |
public Branch createBranch(String name, Branch parentBranch, RouteNodeInstance initialNodeInstance) { |
33 | 0 | Branch branch = new Branch(); |
34 | 0 | branch.setName(name); |
35 | 0 | branch.setParentBranch(parentBranch); |
36 | 0 | branch.setInitialNode(initialNodeInstance); |
37 | 0 | initialNodeInstance.setBranch(branch); |
38 | 0 | return branch; |
39 | |
} |
40 | |
|
41 | |
public RouteNodeInstance createRouteNodeInstance(String documentId, RouteNode node) { |
42 | 0 | RouteNodeInstance nodeInstance = new RouteNodeInstance(); |
43 | 0 | nodeInstance.setActive(false); |
44 | 0 | nodeInstance.setComplete(false); |
45 | 0 | nodeInstance.setRouteNode(node); |
46 | 0 | nodeInstance.setDocumentId(documentId); |
47 | 0 | return nodeInstance; |
48 | |
} |
49 | |
|
50 | |
public RouteNode getRouteNode(RouteContext context, String name) { |
51 | 0 | return KEWServiceLocator.getRouteNodeService().findRouteNodeByName(context.getDocument().getDocumentType().getDocumentTypeId(), name); |
52 | |
} |
53 | |
|
54 | |
} |