001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.clientapp.vo;
018:
019: import java.io.Serializable;
020: import java.util.Calendar;
021:
022: import edu.iu.uis.eden.EdenConstants;
023: import edu.iu.uis.eden.actionrequests.ActionRequestValue;
024:
025: /**
026: * A transport object representing a {@link ActionRequestValue}.
027: *
028: * @author ewestfal
029: * @author rkirkend
030: *
031: * @workflow.webservice-object
032: */
033: public class ActionRequestVO implements Serializable {
034:
035: private final static String ACKNOWLEDGE_REQ = "K";
036: private final static String FYI_REQ = "F";
037: private final static String APPROVE_REQ = "A";
038: private final static String COMPLETE_REQ = "C";
039:
040: static final long serialVersionUID = 1074824814950100121L;
041: private Long actionRequestId;
042: private String actionRequested;
043: private String status;
044: private Boolean currentIndicator = Boolean.TRUE;
045: private Calendar dateCreated;
046: private Long responsibilityId;
047: private Long routeHeaderId;
048: private String routeMethodName;
049: private Integer priority;
050: private String annotation;
051: private Long actionTakenId;
052: private Long workgroupId;
053: private WorkgroupVO workgroupVO;
054: private UserVO userVO;
055: private String recipientTypeCd;
056: private String approvePolicy;
057: private String responsibilityDesc;
058: private Integer routeLevel;
059: private Integer docVersion;
060: private String emplyId;
061: private String roleName;
062: private Boolean ignorePrevAction;
063: private UserIdVO userIdVO;
064: private String delegationType;
065: private ActionRequestVO parentActionRequest;
066: private Long parentActionRequestId;
067: private String qualifiedRoleName;
068: private String qualifiedRoleNameLabel;
069: private ActionRequestVO[] childrenRequests;
070: private ActionTakenVO actionTaken;
071: private String nodeName;
072: private Long nodeInstanceId;
073:
074: public ActionRequestVO() {
075: }
076:
077: public String getRoleName() {
078: return roleName;
079: }
080:
081: public void setRoleName(String roleName) {
082: this .roleName = roleName;
083: }
084:
085: public String getActionRequested() {
086: return actionRequested;
087: }
088:
089: public Long getActionRequestId() {
090: return actionRequestId;
091: }
092:
093: public Long getActionTakenId() {
094: return actionTakenId;
095: }
096:
097: public String getAnnotation() {
098: return annotation;
099: }
100:
101: public Calendar getDateCreated() {
102: return dateCreated;
103: }
104:
105: public Integer getDocVersion() {
106: return docVersion;
107: }
108:
109: public Integer getPriority() {
110: return priority;
111: }
112:
113: public String getResponsibilityDesc() {
114: return responsibilityDesc;
115: }
116:
117: public Long getResponsibilityId() {
118: return responsibilityId;
119: }
120:
121: public Long getRouteHeaderId() {
122: return routeHeaderId;
123: }
124:
125: public Integer getRouteLevel() {
126: return routeLevel;
127: }
128:
129: public String getRouteMethodName() {
130: return routeMethodName;
131: }
132:
133: public String getStatus() {
134: return status;
135: }
136:
137: public Long getWorkgroupId() {
138: return workgroupId;
139: }
140:
141: public void setWorkgroupId(Long workgroupId) {
142: this .workgroupId = workgroupId;
143: }
144:
145: public void setStatus(String status) {
146: this .status = status;
147: }
148:
149: public void setRouteMethodName(String routeMethodName) {
150: this .routeMethodName = routeMethodName;
151: }
152:
153: public void setRouteLevel(Integer routeLevel) {
154: this .routeLevel = routeLevel;
155: }
156:
157: public void setRouteHeaderId(Long routeHeaderId) {
158: this .routeHeaderId = routeHeaderId;
159: }
160:
161: public void setResponsibilityId(Long responsibilityId) {
162: this .responsibilityId = responsibilityId;
163: }
164:
165: public void setResponsibilityDesc(String responsibilityDesc) {
166: this .responsibilityDesc = responsibilityDesc;
167: }
168:
169: public void setPriority(Integer priority) {
170: this .priority = priority;
171: }
172:
173: public void setDocVersion(Integer docVersion) {
174: this .docVersion = docVersion;
175: }
176:
177: public void setDateCreated(Calendar dateCreated) {
178: this .dateCreated = dateCreated;
179: }
180:
181: public void setAnnotation(String annotation) {
182: this .annotation = annotation;
183: }
184:
185: public void setActionTakenId(Long actionTakenId) {
186: this .actionTakenId = actionTakenId;
187: }
188:
189: public void setActionRequestId(Long actionRequestId) {
190: this .actionRequestId = actionRequestId;
191: }
192:
193: public void setActionRequested(String actionRequested) {
194: this .actionRequested = actionRequested;
195: }
196:
197: public String getRecipientTypeCd() {
198: return recipientTypeCd;
199: }
200:
201: public void setRecipientTypeCd(String recipientTypeCd) {
202: this .recipientTypeCd = recipientTypeCd;
203: }
204:
205: public String getApprovePolicy() {
206: return approvePolicy;
207: }
208:
209: public void setApprovePolicy(String approvePolicy) {
210: this .approvePolicy = approvePolicy;
211: }
212:
213: public Boolean getIgnorePrevAction() {
214: return ignorePrevAction;
215: }
216:
217: public UserVO getUserVO() {
218: return userVO;
219: }
220:
221: public void setUserVO(UserVO userVO) {
222: this .userVO = userVO;
223: }
224:
225: public WorkgroupVO getWorkgroupVO() {
226: return workgroupVO;
227: }
228:
229: public void setWorkgroupVO(WorkgroupVO workgroupVO) {
230: this .workgroupVO = workgroupVO;
231: }
232:
233: public boolean isNotificationRequest() {
234: return isAcknowledgeRequest() || isFyiRequest();
235: }
236:
237: public boolean isApprovalRequest() {
238: return APPROVE_REQ.equals(actionRequested)
239: || COMPLETE_REQ.equals(actionRequested);
240: }
241:
242: public void setEmplyId(String emplyId) {
243: this .emplyId = emplyId;
244: }
245:
246: /**
247: *
248: * @return
249: * @deprecated
250: */
251: public String getEmplyId() {
252: return emplyId;
253: }
254:
255: public Boolean isIgnorePrevAction() {
256: return ignorePrevAction;
257: }
258:
259: public void setIgnorePrevAction(Boolean ignorePrevAction) {
260: this .ignorePrevAction = ignorePrevAction;
261: }
262:
263: public boolean isAcknowledgeRequest() {
264: return ACKNOWLEDGE_REQ.equals(actionRequested);
265: }
266:
267: public boolean isFyiRequest() {
268: return FYI_REQ.equals(actionRequested);
269: }
270:
271: public boolean isPending() {
272: return isInitialized() || isActivated();
273: }
274:
275: public boolean isCompleteRequest() {
276: return EdenConstants.ACTION_REQUEST_COMPLETE_REQ
277: .equals(actionRequested);
278: }
279:
280: public boolean isInitialized() {
281: return EdenConstants.ACTION_REQUEST_INITIALIZED.equals(status);
282: }
283:
284: public boolean isActivated() {
285: return EdenConstants.ACTION_REQUEST_ACTIVATED.equals(status);
286: }
287:
288: public boolean isDone() {
289: return EdenConstants.ACTION_REQUEST_DONE_STATE.equals(status);
290: }
291:
292: public boolean isUserRequest() {
293: return EdenConstants.ACTION_REQUEST_USER_RECIPIENT_CD
294: .equals(getRecipientTypeCd());
295: }
296:
297: public boolean isWorkgroupRequest() {
298: return EdenConstants.ACTION_REQUEST_WORKGROUP_RECIPIENT_CD
299: .equals(getRecipientTypeCd());
300: }
301:
302: public boolean isRoleRequest() {
303: return EdenConstants.ACTION_REQUEST_ROLE_RECIPIENT_CD
304: .equals(getRecipientTypeCd());
305: }
306:
307: public UserIdVO getUserIdVO() {
308: return userIdVO;
309: }
310:
311: public void setUserIdVO(UserIdVO userIdVO) {
312: this .userIdVO = userIdVO;
313: }
314:
315: public Boolean getCurrentIndicator() {
316: return currentIndicator;
317: }
318:
319: public void setCurrentIndicator(Boolean currentIndicator) {
320: this .currentIndicator = currentIndicator;
321: }
322:
323: public String getDelegationType() {
324: return delegationType;
325: }
326:
327: public void setDelegationType(String delegationType) {
328: this .delegationType = delegationType;
329: }
330:
331: public ActionRequestVO getParentActionRequest() {
332: return parentActionRequest;
333: }
334:
335: public void setParentActionRequest(
336: ActionRequestVO parentActionRequest) {
337: this .parentActionRequest = parentActionRequest;
338: }
339:
340: public Long getParentActionRequestId() {
341: return parentActionRequestId;
342: }
343:
344: public void setParentActionRequestId(Long parentActionRequestId) {
345: this .parentActionRequestId = parentActionRequestId;
346: }
347:
348: public String getQualifiedRoleName() {
349: return qualifiedRoleName;
350: }
351:
352: public void setQualifiedRoleName(String qualifiedRoleName) {
353: this .qualifiedRoleName = qualifiedRoleName;
354: }
355:
356: public String getQualifiedRoleNameLabel() {
357: return qualifiedRoleNameLabel;
358: }
359:
360: public void setQualifiedRoleNameLabel(String qualifiedRoleNameLabel) {
361: this .qualifiedRoleNameLabel = qualifiedRoleNameLabel;
362: }
363:
364: public ActionTakenVO getActionTaken() {
365: return actionTaken;
366: }
367:
368: public void setActionTaken(ActionTakenVO actionTaken) {
369: this .actionTaken = actionTaken;
370: }
371:
372: public ActionRequestVO[] getChildrenRequests() {
373: return childrenRequests;
374: }
375:
376: public void setChildrenRequests(ActionRequestVO[] childrenRequests) {
377: this .childrenRequests = childrenRequests;
378: }
379:
380: public void addChildRequest(ActionRequestVO childRequest) {
381: if (getChildrenRequests() == null) {
382: setChildrenRequests(new ActionRequestVO[0]);
383: }
384: ActionRequestVO[] newChildrenRequests = new ActionRequestVO[getChildrenRequests().length + 1];
385: System.arraycopy(getChildrenRequests(), 0, newChildrenRequests,
386: 0, getChildrenRequests().length);
387: newChildrenRequests[getChildrenRequests().length] = childRequest;
388: setChildrenRequests(newChildrenRequests);
389: }
390:
391: public String getNodeName() {
392: return nodeName;
393: }
394:
395: public void setNodeName(String nodeName) {
396: this .nodeName = nodeName;
397: }
398:
399: public Long getNodeInstanceId() {
400: return nodeInstanceId;
401: }
402:
403: public void setNodeInstanceId(Long nodeInstanceId) {
404: this .nodeInstanceId = nodeInstanceId;
405: }
406:
407: public boolean isDelegateRequest() {
408: if (getParentActionRequest() != null) {
409: if (getParentActionRequest().isRoleRequest()) {
410: return getParentActionRequest().isDelegateRequest();
411: }
412: return true;
413: }
414: return false;
415: }
416:
417: public boolean isAdHocRequest() {
418: return EdenConstants.ADHOC_REQUEST_RESPONSIBILITY_ID
419: .equals(getResponsibilityId());
420: }
421:
422: public boolean isGeneratedRequest() {
423: return EdenConstants.MACHINE_GENERATED_RESPONSIBILITY_ID
424: .equals(getResponsibilityId());
425: }
426:
427: public boolean isExceptionRequest() {
428: return EdenConstants.EXCEPTION_REQUEST_RESPONSIBILITY_ID
429: .equals(getResponsibilityId());
430: }
431:
432: public boolean isRouteModuleRequest() {
433: return getResponsibilityId().longValue() > 0;
434: }
435: }
|