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