01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.clientapp.vo;
18:
19: import java.util.HashMap;
20: import java.util.Map;
21:
22: import edu.iu.uis.eden.clientapp.WorkflowInfo;
23:
24: /**
25: * Document plus it's requests and actions. Primarily used by the routingReport method
26: * on the {@link WorkflowInfo}
27: *
28: * @author ewestfal
29: *
30: * @workflow.webservice-object
31: */
32: public class DocumentDetailVO extends RouteHeaderVO {
33:
34: private static final long serialVersionUID = -6089529693944755804L;
35:
36: private ActionRequestVO[] actionRequests = new ActionRequestVO[0];
37: private ActionTakenVO[] actionsTaken = new ActionTakenVO[0];
38: private RouteNodeInstanceVO[] nodeInstances = new RouteNodeInstanceVO[0];
39:
40: private Map nodeInstanceMap = null;
41:
42: public ActionRequestVO[] getActionRequests() {
43: return actionRequests;
44: }
45:
46: public void setActionRequests(ActionRequestVO[] actionRequests) {
47: this .actionRequests = actionRequests;
48: }
49:
50: public ActionTakenVO[] getActionsTaken() {
51: return actionsTaken;
52: }
53:
54: public void setActionsTaken(ActionTakenVO[] actionsTaken) {
55: this .actionsTaken = actionsTaken;
56: }
57:
58: public RouteNodeInstanceVO[] getNodeInstances() {
59: return nodeInstances;
60: }
61:
62: public void setNodeInstances(RouteNodeInstanceVO[] nodeInstances) {
63: this .nodeInstances = nodeInstances;
64: }
65:
66: public RouteNodeInstanceVO getNodeInstance(Long nodeInstanceId) {
67: if (nodeInstanceMap == null) {
68: populateNodeInstanceMap();
69: }
70: return (RouteNodeInstanceVO) nodeInstanceMap
71: .get(nodeInstanceId);
72: }
73:
74: private void populateNodeInstanceMap() {
75: nodeInstanceMap = new HashMap();
76: for (int index = 0; index < nodeInstances.length; index++) {
77: RouteNodeInstanceVO nodeInstance = nodeInstances[index];
78: nodeInstanceMap.put(nodeInstance.getRouteNodeInstanceId(),
79: nodeInstance);
80: }
81: }
82:
83: }
|