Coverage Report - org.kuali.rice.kew.dto.ActionRequestDTO
 
Classes in this File Line Coverage Branch Coverage Complexity
ActionRequestDTO
0%
0/113
0%
0/16
1.052
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  *
 4  
  *
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  * http://www.opensource.org/licenses/ecl2.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 org.kuali.rice.kew.dto;
 18  
 
 19  
 import java.io.Serializable;
 20  
 import java.util.Calendar;
 21  
 
 22  
 import org.kuali.rice.kew.util.KEWConstants;
 23  
 
 24  
 
 25  
 /**
 26  
  * A transport object representing an ActionRequestValue.
 27  
  *
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  */
 30  
 public class ActionRequestDTO implements Serializable {
 31  
 
 32  
     private final static String ACKNOWLEDGE_REQ = "K";
 33  
     private final static String FYI_REQ = "F";
 34  
     private final static String APPROVE_REQ = "A";
 35  
     private final static String COMPLETE_REQ = "C";
 36  
 
 37  
     static final long serialVersionUID = 1074824814950100121L;
 38  
     private Long actionRequestId;
 39  
     private String actionRequested;
 40  
     private String status;
 41  0
     private Boolean currentIndicator = Boolean.TRUE;
 42  
     private Calendar dateCreated;
 43  
     private Long responsibilityId;
 44  
     private Long routeHeaderId;
 45  
     private String routeMethodName;
 46  
     private Integer priority;
 47  
     private String annotation;
 48  
     private Long actionTakenId;
 49  
     private String groupId;    
 50  
     private String recipientTypeCd;
 51  
     private String approvePolicy;
 52  
     private String responsibilityDesc;
 53  
     private Integer routeLevel;
 54  
     private Integer docVersion;
 55  
     private String roleName;
 56  
     private Boolean forceAction;
 57  
     private String principalId;
 58  
     private String delegationType;
 59  
     private Long parentActionRequestId;
 60  
     private String qualifiedRoleName;
 61  
     private String qualifiedRoleNameLabel;
 62  
     private ActionRequestDTO[] childrenRequests;
 63  
     private ActionTakenDTO actionTaken;
 64  
     private String nodeName;
 65  
     private Long nodeInstanceId;
 66  
     private String requestLabel;
 67  
 
 68  0
     public ActionRequestDTO() {}
 69  
 
 70  
     public String getRoleName() {
 71  0
         return roleName;
 72  
     }
 73  
 
 74  
     public void setRoleName(String roleName) {
 75  0
         this.roleName = roleName;
 76  0
     }
 77  
 
 78  
     public String getActionRequested() {
 79  0
         return actionRequested;
 80  
     }
 81  
 
 82  
     public Long getActionRequestId() {
 83  0
         return actionRequestId;
 84  
     }
 85  
 
 86  
     public Long getActionTakenId() {
 87  0
         return actionTakenId;
 88  
     }
 89  
 
 90  
     public String getAnnotation() {
 91  0
         return annotation;
 92  
     }
 93  
 
 94  
     public Calendar getDateCreated() {
 95  0
         return dateCreated;
 96  
     }
 97  
 
 98  
     public Integer getDocVersion() {
 99  0
         return docVersion;
 100  
     }
 101  
 
 102  
     public Integer getPriority() {
 103  0
         return priority;
 104  
     }
 105  
 
 106  
     public String getResponsibilityDesc() {
 107  0
         return responsibilityDesc;
 108  
     }
 109  
 
 110  
     public Long getResponsibilityId() {
 111  0
         return responsibilityId;
 112  
     }
 113  
 
 114  
     public Long getRouteHeaderId() {
 115  0
         return routeHeaderId;
 116  
     }
 117  
 
 118  
     public Integer getRouteLevel() {
 119  0
         return routeLevel;
 120  
     }
 121  
 
 122  
     public String getRouteMethodName() {
 123  0
         return routeMethodName;
 124  
     }
 125  
 
 126  
     public String getStatus() {
 127  0
         return status;
 128  
     }
 129  
  
 130  
     public void setStatus(String status) {
 131  0
         this.status = status;
 132  0
     }
 133  
 
 134  
     public void setRouteMethodName(String routeMethodName) {
 135  0
         this.routeMethodName = routeMethodName;
 136  0
     }
 137  
 
 138  
     public void setRouteLevel(Integer routeLevel) {
 139  0
         this.routeLevel = routeLevel;
 140  0
     }
 141  
 
 142  
     public void setRouteHeaderId(Long routeHeaderId) {
 143  0
         this.routeHeaderId = routeHeaderId;
 144  0
     }
 145  
 
 146  
     public void setResponsibilityId(Long responsibilityId) {
 147  0
         this.responsibilityId = responsibilityId;
 148  0
     }
 149  
 
 150  
     public void setResponsibilityDesc(String responsibilityDesc) {
 151  0
         this.responsibilityDesc = responsibilityDesc;
 152  0
     }
 153  
 
 154  
     public void setPriority(Integer priority) {
 155  0
         this.priority = priority;
 156  0
     }
 157  
 
 158  
     public void setDocVersion(Integer docVersion) {
 159  0
         this.docVersion = docVersion;
 160  0
     }
 161  
 
 162  
     public void setDateCreated(Calendar dateCreated) {
 163  0
         this.dateCreated = dateCreated;
 164  0
     }
 165  
 
 166  
     public void setAnnotation(String annotation) {
 167  0
         this.annotation = annotation;
 168  0
     }
 169  
 
 170  
     public void setActionTakenId(Long actionTakenId) {
 171  0
         this.actionTakenId = actionTakenId;
 172  0
     }
 173  
 
 174  
     public void setActionRequestId(Long actionRequestId) {
 175  0
         this.actionRequestId = actionRequestId;
 176  0
     }
 177  
 
 178  
     public void setActionRequested(String actionRequested) {
 179  0
         this.actionRequested = actionRequested;
 180  0
     }
 181  
 
 182  
     public String getRecipientTypeCd() {
 183  0
         return recipientTypeCd;
 184  
     }
 185  
 
 186  
     public void setRecipientTypeCd(String recipientTypeCd) {
 187  0
         this.recipientTypeCd = recipientTypeCd;
 188  0
     }
 189  
 
 190  
     public String getApprovePolicy() {
 191  0
         return approvePolicy;
 192  
     }
 193  
 
 194  
     public void setApprovePolicy(String approvePolicy) {
 195  0
         this.approvePolicy = approvePolicy;
 196  0
     }
 197  
 
 198  
     public Boolean getForceAction() {
 199  0
         return forceAction;
 200  
     }
 201  
 
 202  
     public boolean isNotificationRequest() {
 203  0
         return isAcknowledgeRequest() || isFyiRequest();
 204  
     }
 205  
 
 206  
     public boolean isApprovalRequest() {
 207  0
         return APPROVE_REQ.equals(actionRequested) || COMPLETE_REQ.equals(actionRequested);
 208  
     }
 209  
 
 210  
     public Boolean isForceAction() {
 211  0
         return forceAction;
 212  
     }
 213  
 
 214  
     public void setForceAction(Boolean forceAction) {
 215  0
         this.forceAction = forceAction;
 216  0
     }
 217  
 
 218  
     public boolean isAcknowledgeRequest() {
 219  0
         return ACKNOWLEDGE_REQ.equals(actionRequested);
 220  
     }
 221  
 
 222  
     public boolean isFyiRequest() {
 223  0
         return FYI_REQ.equals(actionRequested);
 224  
     }
 225  
 
 226  
     public boolean isPending() {
 227  0
         return isInitialized() || isActivated();
 228  
     }
 229  
 
 230  
     public boolean isCompleteRequest() {
 231  0
         return KEWConstants.ACTION_REQUEST_COMPLETE_REQ.equals(actionRequested);
 232  
     }
 233  
 
 234  
     public boolean isInitialized() {
 235  0
         return KEWConstants.ACTION_REQUEST_INITIALIZED.equals(status);
 236  
     }
 237  
 
 238  
     public boolean isActivated() {
 239  0
         return KEWConstants.ACTION_REQUEST_ACTIVATED.equals(status);
 240  
     }
 241  
 
 242  
     public boolean isDone() {
 243  0
         return KEWConstants.ACTION_REQUEST_DONE_STATE.equals(status);
 244  
     }
 245  
 
 246  
     public boolean isUserRequest() {
 247  0
         return KEWConstants.ACTION_REQUEST_USER_RECIPIENT_CD.equals(getRecipientTypeCd());
 248  
     }
 249  
 
 250  
     public boolean isGroupRequest() {
 251  0
         return KEWConstants.ACTION_REQUEST_GROUP_RECIPIENT_CD.equals(getRecipientTypeCd());
 252  
     }
 253  
 
 254  
     public boolean isRoleRequest() {
 255  0
         return KEWConstants.ACTION_REQUEST_ROLE_RECIPIENT_CD.equals(getRecipientTypeCd());
 256  
     }
 257  
 
 258  
     public String getPrincipalId() {
 259  0
                 return this.principalId;
 260  
         }
 261  
 
 262  
         public void setPrincipalId(String principalId) {
 263  0
                 this.principalId = principalId;
 264  0
         }
 265  
 
 266  
         public Boolean getCurrentIndicator() {
 267  0
         return currentIndicator;
 268  
     }
 269  
 
 270  
     public void setCurrentIndicator(Boolean currentIndicator) {
 271  0
         this.currentIndicator = currentIndicator;
 272  0
     }
 273  
 
 274  
     public String getDelegationType() {
 275  0
         return delegationType;
 276  
     }
 277  
     public void setDelegationType(String delegationType) {
 278  0
         this.delegationType = delegationType;
 279  0
     }
 280  
 
 281  
     public Long getParentActionRequestId() {
 282  0
         return parentActionRequestId;
 283  
     }
 284  
     public void setParentActionRequestId(Long parentActionRequestId) {
 285  0
         this.parentActionRequestId = parentActionRequestId;
 286  0
     }
 287  
 
 288  
     public String getQualifiedRoleName() {
 289  0
         return qualifiedRoleName;
 290  
     }
 291  
     public void setQualifiedRoleName(String qualifiedRoleName) {
 292  0
         this.qualifiedRoleName = qualifiedRoleName;
 293  0
     }
 294  
     public String getQualifiedRoleNameLabel() {
 295  0
         return qualifiedRoleNameLabel;
 296  
     }
 297  
     public void setQualifiedRoleNameLabel(String qualifiedRoleNameLabel) {
 298  0
         this.qualifiedRoleNameLabel = qualifiedRoleNameLabel;
 299  0
     }
 300  
 
 301  
         public ActionTakenDTO getActionTaken() {
 302  0
                 return actionTaken;
 303  
         }
 304  
 
 305  
         public void setActionTaken(ActionTakenDTO actionTaken) {
 306  0
                 this.actionTaken = actionTaken;
 307  0
         }
 308  
 
 309  
     public ActionRequestDTO[] getChildrenRequests() {
 310  0
         return childrenRequests;
 311  
     }
 312  
     public void setChildrenRequests(ActionRequestDTO[] childrenRequests) {
 313  0
         this.childrenRequests = childrenRequests;
 314  0
     }
 315  
 
 316  
     public void addChildRequest(ActionRequestDTO childRequest) {
 317  0
             if (getChildrenRequests() == null) {
 318  0
                     setChildrenRequests(new ActionRequestDTO[0]);
 319  
             }
 320  0
             ActionRequestDTO[] newChildrenRequests = new ActionRequestDTO[getChildrenRequests().length+1];
 321  0
             System.arraycopy(getChildrenRequests(), 0, newChildrenRequests, 0, getChildrenRequests().length);
 322  0
             newChildrenRequests[getChildrenRequests().length] = childRequest;
 323  0
             setChildrenRequests(newChildrenRequests);
 324  0
     }
 325  
 
 326  
     public String getNodeName() {
 327  0
         return nodeName;
 328  
     }
 329  
 
 330  
     public void setNodeName(String nodeName) {
 331  0
         this.nodeName = nodeName;
 332  0
     }
 333  
 
 334  
     public Long getNodeInstanceId() {
 335  0
         return nodeInstanceId;
 336  
     }
 337  
 
 338  
     public void setNodeInstanceId(Long nodeInstanceId) {
 339  0
         this.nodeInstanceId = nodeInstanceId;
 340  0
     }
 341  
     
 342  
     public String getGroupId() {
 343  0
                 return this.groupId;
 344  
         }
 345  
 
 346  
         public void setGroupId(String groupId) {
 347  0
                 this.groupId = groupId;
 348  0
         }
 349  
 
 350  
     public boolean isAdHocRequest() {
 351  0
             return KEWConstants.ADHOC_REQUEST_RESPONSIBILITY_ID.equals(getResponsibilityId());
 352  
     }
 353  
 
 354  
     public boolean isGeneratedRequest() {
 355  0
             return KEWConstants.MACHINE_GENERATED_RESPONSIBILITY_ID.equals(getResponsibilityId());
 356  
     }
 357  
 
 358  
     public boolean isExceptionRequest() {
 359  0
             return KEWConstants.EXCEPTION_REQUEST_RESPONSIBILITY_ID.equals(getResponsibilityId());
 360  
     }
 361  
 
 362  
     public boolean isRouteModuleRequest() {
 363  0
             return getResponsibilityId().longValue() > 0;
 364  
     }
 365  
 
 366  
         public String getRequestLabel() {
 367  0
                 return this.requestLabel;
 368  
         }
 369  
 
 370  
         public void setRequestLabel(String requestLabel) {
 371  0
                 this.requestLabel = requestLabel;
 372  0
         }
 373  
 
 374  
 }