| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| KualiWorkflowDocument |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2005-2007 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl2.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.kuali.rice.krad.workflow.service; | |
| 17 | ||
| 18 | import java.sql.Timestamp; | |
| 19 | import java.util.Set; | |
| 20 | ||
| 21 | import org.kuali.rice.kew.dto.ReturnPointDTO; | |
| 22 | import org.kuali.rice.kew.dto.RouteHeaderDTO; | |
| 23 | import org.kuali.rice.kew.dto.UserIdDTO; | |
| 24 | import org.kuali.rice.kew.dto.WorkflowAttributeDefinitionDTO; | |
| 25 | import org.kuali.rice.kew.exception.InvalidActionTakenException; | |
| 26 | import org.kuali.rice.kew.exception.ResourceUnavailableException; | |
| 27 | import org.kuali.rice.kew.exception.WorkflowException; | |
| 28 | import org.kuali.rice.kew.service.WorkflowDocumentActions; | |
| 29 | import org.kuali.rice.kim.bo.Person; | |
| 30 | ||
| 31 | public interface KualiWorkflowDocument { | |
| 32 | ||
| 33 | public abstract String getApplicationContent(); | |
| 34 | ||
| 35 | /** | |
| 36 | * Sets the application specific document content. | |
| 37 | */ | |
| 38 | public abstract void setApplicationContent(String applicationContent); | |
| 39 | ||
| 40 | /** | |
| 41 | * Clears all attribute document content from the document. Typically, this will be used if it is necessary to update the | |
| 42 | * attribute doc content on the document. This can be accomplished by clearing the content and then adding the desired attribute | |
| 43 | * definitions. | |
| 44 | * | |
| 45 | * In order for these changes to take effect, an action must be performed on the document (such as "save"). | |
| 46 | */ | |
| 47 | public abstract void clearAttributeContent(); | |
| 48 | ||
| 49 | /** | |
| 50 | * Returns the attribute-generated document content. | |
| 51 | */ | |
| 52 | public abstract String getAttributeContent(); | |
| 53 | ||
| 54 | /** | |
| 55 | * Adds an attribute definition which defines creation parameters for a WorkflowAttribute implementation. The created attribute | |
| 56 | * will be used to generate attribute document content. When the document is sent to the server, this will be appended to the | |
| 57 | * existing attribute doc content. If it is required to replace the attribute document content, then the clearAttributeContent() | |
| 58 | * method should be invoked prior to adding attribute definitions. | |
| 59 | */ | |
| 60 | public abstract void addAttributeDefinition(WorkflowAttributeDefinitionDTO attributeDefinition); | |
| 61 | ||
| 62 | public abstract void removeAttributeDefinition(WorkflowAttributeDefinitionDTO attributeDefinition); | |
| 63 | ||
| 64 | public abstract void clearAttributeDefinitions(); | |
| 65 | ||
| 66 | public abstract WorkflowAttributeDefinitionDTO[] getAttributeDefinitions(); | |
| 67 | ||
| 68 | /** | |
| 69 | * Adds a searchable attribute definition which defines creation parameters for a SearchableAttribute implementation. The | |
| 70 | * created attribute will be used to generate searchable document content. When the document is sent to the server, this will be | |
| 71 | * appended to the existing searchable doc content. If it is required to replace the searchable document content, then the | |
| 72 | * clearSearchableContent() method should be invoked prior to adding definitions. | |
| 73 | */ | |
| 74 | public abstract void addSearchableDefinition(WorkflowAttributeDefinitionDTO searchableDefinition); | |
| 75 | ||
| 76 | public abstract void removeSearchableDefinition(WorkflowAttributeDefinitionDTO searchableDefinition); | |
| 77 | ||
| 78 | public abstract void clearSearchableDefinitions(); | |
| 79 | ||
| 80 | public abstract WorkflowAttributeDefinitionDTO[] getSearchableDefinitions(); | |
| 81 | ||
| 82 | // ######################## | |
| 83 | public abstract RouteHeaderDTO getRouteHeader(); | |
| 84 | ||
| 85 | public abstract String getDocumentId() throws WorkflowException; | |
| 86 | ||
| 87 | public abstract void setAppDocId(String appDocId); | |
| 88 | ||
| 89 | public abstract String getAppDocId(); | |
| 90 | ||
| 91 | public abstract String getInitiatorPrincipalId(); | |
| 92 | ||
| 93 | public abstract String getRoutedByPrincipalId(); | |
| 94 | ||
| 95 | public abstract String getTitle(); | |
| 96 | ||
| 97 | public abstract void saveDocument(String annotation) throws WorkflowException; | |
| 98 | ||
| 99 | public abstract void routeDocument(String annotation) throws WorkflowException; | |
| 100 | ||
| 101 | public abstract void disapprove(String annotation) throws WorkflowException; | |
| 102 | ||
| 103 | public abstract void approve(String annotation) throws WorkflowException; | |
| 104 | ||
| 105 | public abstract void superUserApprove(String annotation) throws WorkflowException; | |
| 106 | ||
| 107 | public void superUserActionRequestApprove(Long actionRequestId, String annotation) throws WorkflowException; | |
| 108 | ||
| 109 | public void superUserCancel(String annotation) throws WorkflowException; | |
| 110 | ||
| 111 | public void superUserDisapprove(String annotation) throws WorkflowException; | |
| 112 | ||
| 113 | public abstract void cancel(String annotation) throws WorkflowException; | |
| 114 | ||
| 115 | public abstract void blanketApprove(String annotation) throws WorkflowException; | |
| 116 | ||
| 117 | public abstract void saveRoutingData() throws WorkflowException; | |
| 118 | ||
| 119 | public abstract void acknowledge(String annotation) throws WorkflowException; | |
| 120 | ||
| 121 | public abstract void fyi() throws WorkflowException; | |
| 122 | ||
| 123 | public abstract void delete() throws WorkflowException; | |
| 124 | ||
| 125 | public abstract void refreshContent() throws WorkflowException; | |
| 126 | ||
| 127 | public abstract void adHocRouteDocumentToPrincipal(String actionRequested, String routeTypeName, String annotation, String principalId, String responsibilityDesc, boolean forceAction) throws WorkflowException; | |
| 128 | ||
| 129 | public abstract void adHocRouteDocumentToGroup(String actionRequested, String routeTypeName, String annotation, String groupId, String responsibilityDesc, boolean forceAction) throws WorkflowException; | |
| 130 | ||
| 131 | public abstract void adHocRouteDocumentToPrincipal(String actionRequested, String routeTypeName, String annotation, String principalId, String responsibilityDesc, boolean forceAction, String actionRequestLabel) throws WorkflowException; | |
| 132 | ||
| 133 | public abstract void adHocRouteDocumentToGroup(String actionRequested, String routeTypeName, String annotation, String groupId, String responsibilityDesc, boolean forceAction, String actionRequestLabel) throws WorkflowException; | |
| 134 | ||
| 135 | public abstract void setTitle(String title) throws WorkflowException; | |
| 136 | ||
| 137 | public abstract String getDocumentType(); | |
| 138 | ||
| 139 | /** | |
| 140 | * This method determines whether workflowDocument.getUserId() currently has an ad hoc request is his/her action list | |
| 141 | * | |
| 142 | * @return boolean indicating whether there is an active ad hoc request for this user | |
| 143 | */ | |
| 144 | public boolean isAdHocRequested(); | |
| 145 | ||
| 146 | /** | |
| 147 | * | |
| 148 | * Returns true if the user currently has this document in their Action List with an Acknowledge Request. | |
| 149 | * | |
| 150 | * The user in this case is whatever user was passed in when the document was loaded. This is typically the current webapp user. | |
| 151 | * | |
| 152 | * @return true if the user has the document in their Action List waiting for an Acknowledgement, false otherwise. | |
| 153 | * | |
| 154 | */ | |
| 155 | public abstract boolean isAcknowledgeRequested(); | |
| 156 | ||
| 157 | /** | |
| 158 | * | |
| 159 | * Returns true if the user currently has this document in their Action List with an Approval Request. | |
| 160 | * | |
| 161 | * The user in this case is whatever user was passed in when the document was loaded. This is typically the current webapp user. | |
| 162 | * | |
| 163 | * @return true if the user has the document in their Action List waiting for an Approval, false otherwise. | |
| 164 | * | |
| 165 | */ | |
| 166 | public abstract boolean isApprovalRequested(); | |
| 167 | ||
| 168 | /** | |
| 169 | * | |
| 170 | * Returns true if the user currently has this document in their Action List with an Completion Request. | |
| 171 | * | |
| 172 | * The user in this case is whatever user was passed in when the document was loaded. This is typically the current webapp user. | |
| 173 | * | |
| 174 | * @return true if the user has the document in their Action List waiting for a Completion, false otherwise. | |
| 175 | * | |
| 176 | */ | |
| 177 | public abstract boolean isCompletionRequested(); | |
| 178 | ||
| 179 | /** | |
| 180 | * | |
| 181 | * Returns true if the user currently has this document in their Action List with an FYI. | |
| 182 | * | |
| 183 | * The user in this case is whatever user was passed in when the document was loaded. This is typically the current webapp user. | |
| 184 | * | |
| 185 | * @return true if the user has the document in their Action List waiting for an FYI, false otherwise. | |
| 186 | * | |
| 187 | */ | |
| 188 | public abstract boolean isFYIRequested(); | |
| 189 | ||
| 190 | /** | |
| 191 | * | |
| 192 | * Returns true if the user is authorized to Blanket Approve this document. | |
| 193 | * | |
| 194 | * The user in this case is whatever user was passed in when the document was loaded. This is typically the current webapp user. | |
| 195 | * | |
| 196 | * @return true if the user is authorized to Blanket Approve this document, false otherwise. | |
| 197 | * | |
| 198 | */ | |
| 199 | public abstract boolean isBlanketApproveCapable(); | |
| 200 | ||
| 201 | /** | |
| 202 | * Checks to see if this document is allowed to have a standard 'save' performed | |
| 203 | * | |
| 204 | * @return true if the saveDocument() method is valid to be called.... false otherwise | |
| 205 | */ | |
| 206 | public boolean isStandardSaveAllowed(); | |
| 207 | ||
| 208 | /** | |
| 209 | * @param annotation | |
| 210 | * @throws InvalidActionTakenException | |
| 211 | * @throws ResourceUnavailableException | |
| 212 | * @throws WorkflowException | |
| 213 | */ | |
| 214 | public abstract void complete(String annotation) throws WorkflowException; | |
| 215 | ||
| 216 | /** | |
| 217 | * Performs the 'returnToPrevious' action on the document this WorkflowDocument represents. If this is a new document, | |
| 218 | * the document is created first. | |
| 219 | * @param annotation the message to log for the action | |
| 220 | * @param nodeName the node to return to | |
| 221 | * @throws WorkflowException in case an error occurs returning to previous node | |
| 222 | * @see WorkflowDocumentActions#returnDocumentToPreviousNode(UserIdDTO, RouteHeaderDTO, ReturnPointDTO, String) | |
| 223 | */ | |
| 224 | public void returnToPreviousNode(String annotation, String nodeName) throws WorkflowException; | |
| 225 | ||
| 226 | /** | |
| 227 | * Performs the 'returnToPrevious' action on the document this WorkflowDocument represents. If this is a new document, | |
| 228 | * the document is created first. | |
| 229 | * @param annotation the message to log for the action | |
| 230 | * @param ReturnPointDTO the node to return to | |
| 231 | * @throws WorkflowException in case an error occurs returning to previous node | |
| 232 | * @see WorkflowDocumentActions#returnDocumentToPreviousNode(UserIdDTO, RouteHeaderDTO, ReturnPointDTO, String) | |
| 233 | */ | |
| 234 | public void returnToPreviousNode(String annotation, ReturnPointDTO returnPoint) throws WorkflowException; | |
| 235 | ||
| 236 | public abstract void logDocumentAction(String annotation) throws WorkflowException; | |
| 237 | ||
| 238 | /** | |
| 239 | * Indicates if the document is in the initated state or not. | |
| 240 | * | |
| 241 | * @return true if in the specified state | |
| 242 | */ | |
| 243 | public abstract boolean stateIsInitiated(); | |
| 244 | ||
| 245 | /** | |
| 246 | * Indicates if the document is in the saved state or not. | |
| 247 | * | |
| 248 | * @return true if in the specified state | |
| 249 | */ | |
| 250 | public abstract boolean stateIsSaved(); | |
| 251 | ||
| 252 | /** | |
| 253 | * Indicates if the document is in the enroute state or not. | |
| 254 | * | |
| 255 | * @return true if in the specified state | |
| 256 | */ | |
| 257 | public abstract boolean stateIsEnroute(); | |
| 258 | ||
| 259 | ||
| 260 | /** | |
| 261 | * Indicates if the document is in the final state or not. | |
| 262 | * | |
| 263 | * @return true if in the specified state | |
| 264 | */ | |
| 265 | public abstract boolean stateIsFinal(); | |
| 266 | ||
| 267 | /** | |
| 268 | * Indicates if the document is in the exception state or not. | |
| 269 | * | |
| 270 | * @return true if in the specified state | |
| 271 | */ | |
| 272 | public abstract boolean stateIsException(); | |
| 273 | ||
| 274 | /** | |
| 275 | * Indicates if the document is in the canceled state or not. | |
| 276 | * | |
| 277 | * @return true if in the specified state | |
| 278 | */ | |
| 279 | public abstract boolean stateIsCanceled(); | |
| 280 | ||
| 281 | /** | |
| 282 | * Indicates if the document is in the disapproved state or not. | |
| 283 | * | |
| 284 | * @return true if in the specified state | |
| 285 | */ | |
| 286 | public abstract boolean stateIsDisapproved(); | |
| 287 | ||
| 288 | /** | |
| 289 | * Indicates if the document is in the approved state or not. Will answer true is document is in Processed or Finalized state. | |
| 290 | * | |
| 291 | * @return true if in the specified state | |
| 292 | */ | |
| 293 | public abstract boolean stateIsApproved(); | |
| 294 | ||
| 295 | /** | |
| 296 | * Indicates if the document is in the processed state or not. | |
| 297 | * | |
| 298 | * @return true if in the specified state | |
| 299 | */ | |
| 300 | public abstract boolean stateIsProcessed(); | |
| 301 | ||
| 302 | public abstract String getStatusDisplayValue(); | |
| 303 | ||
| 304 | public abstract Timestamp getCreateDate(); | |
| 305 | ||
| 306 | ||
| 307 | /** | |
| 308 | * Returns true if the principalName of the given KualiUser matches the initiatorNetworkId of this document | |
| 309 | * | |
| 310 | * @param user | |
| 311 | * @return true if the given user is the initiator of this document | |
| 312 | */ | |
| 313 | public boolean userIsInitiator(Person user); | |
| 314 | ||
| 315 | /** | |
| 316 | * Returns true if the principalName of the given KualiUser matches the routedByUserNetworkId of this document | |
| 317 | * | |
| 318 | * @param user | |
| 319 | * @return true if the given user is the user who routed this document | |
| 320 | */ | |
| 321 | public boolean userIsRoutedByUser(Person user); | |
| 322 | ||
| 323 | /** | |
| 324 | * Returns the names of the nodes that the document is currently at. | |
| 325 | */ | |
| 326 | public String[] getNodeNames() throws WorkflowException; | |
| 327 | ||
| 328 | /** | |
| 329 | * Returns the current node names of the document delimited by the constant: | |
| 330 | * {@link DocumentRouteHeaderValue#CURRENT_ROUTE_NODE_NAME_DELIMITER} | |
| 331 | */ | |
| 332 | public String getCurrentRouteNodeNames(); | |
| 333 | ||
| 334 | /** | |
| 335 | * This method returns a set of all approvers of this document. | |
| 336 | * | |
| 337 | * @return a set of all approvers | |
| 338 | */ | |
| 339 | public Set<Person> getAllPriorApprovers() throws WorkflowException; | |
| 340 | ||
| 341 | public void setReceiveFutureRequests() throws WorkflowException; | |
| 342 | ||
| 343 | public void setDoNotReceiveFutureRequests() throws WorkflowException; | |
| 344 | ||
| 345 | public void setClearFutureRequests() throws WorkflowException; | |
| 346 | } |