1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.kew.dto;
18
19 import java.util.HashMap;
20 import java.util.Map;
21
22
23
24
25
26
27
28 public class DocumentDetailDTO extends RouteHeaderDTO {
29
30 private static final long serialVersionUID = -6089529693944755804L;
31
32 private ActionRequestDTO[] actionRequests = new ActionRequestDTO[0];
33 private ActionTakenDTO[] actionsTaken = new ActionTakenDTO[0];
34 private RouteNodeInstanceDTO[] nodeInstances = new RouteNodeInstanceDTO[0];
35
36 private Map nodeInstanceMap = null;
37
38 public ActionRequestDTO[] getActionRequests() {
39 return actionRequests;
40 }
41
42 public void setActionRequests(ActionRequestDTO[] actionRequests) {
43 this.actionRequests = actionRequests;
44 }
45
46 public ActionTakenDTO[] getActionsTaken() {
47 return actionsTaken;
48 }
49
50 public void setActionsTaken(ActionTakenDTO[] actionsTaken) {
51 this.actionsTaken = actionsTaken;
52 }
53
54 public RouteNodeInstanceDTO[] getNodeInstances() {
55 return nodeInstances;
56 }
57
58 public void setNodeInstances(RouteNodeInstanceDTO[] nodeInstances) {
59 this.nodeInstances = nodeInstances;
60 }
61
62 public RouteNodeInstanceDTO getNodeInstance(Long nodeInstanceId) {
63 if (nodeInstanceMap == null) {
64 populateNodeInstanceMap();
65 }
66 return (RouteNodeInstanceDTO)nodeInstanceMap.get(nodeInstanceId);
67 }
68
69 private void populateNodeInstanceMap() {
70 nodeInstanceMap = new HashMap();
71 for (int index = 0; index < nodeInstances.length; index++) {
72 RouteNodeInstanceDTO nodeInstance = nodeInstances[index];
73 nodeInstanceMap.put(nodeInstance.getRouteNodeInstanceId(), nodeInstance);
74 }
75 }
76
77
78
79 }