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.kns.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 | public abstract Integer getDocRouteLevel(); | |
209 | ||
210 | /** | |
211 | * @param annotation | |
212 | * @throws InvalidActionTakenException | |
213 | * @throws ResourceUnavailableException | |
214 | * @throws WorkflowException | |
215 | */ | |
216 | public abstract void complete(String annotation) throws WorkflowException; | |
217 | ||
218 | /** | |
219 | * Performs the 'returnToPrevious' action on the document this WorkflowDocument represents. If this is a new document, | |
220 | * the document is created first. | |
221 | * @param annotation the message to log for the action | |
222 | * @param nodeName the node to return to | |
223 | * @throws WorkflowException in case an error occurs returning to previous node | |
224 | * @see WorkflowDocumentActions#returnDocumentToPreviousNode(UserIdDTO, RouteHeaderDTO, ReturnPointDTO, String) | |
225 | */ | |
226 | public void returnToPreviousNode(String annotation, String nodeName) throws WorkflowException; | |
227 | ||
228 | /** | |
229 | * Performs the 'returnToPrevious' action on the document this WorkflowDocument represents. If this is a new document, | |
230 | * the document is created first. | |
231 | * @param annotation the message to log for the action | |
232 | * @param ReturnPointDTO the node to return to | |
233 | * @throws WorkflowException in case an error occurs returning to previous node | |
234 | * @see WorkflowDocumentActions#returnDocumentToPreviousNode(UserIdDTO, RouteHeaderDTO, ReturnPointDTO, String) | |
235 | */ | |
236 | public void returnToPreviousNode(String annotation, ReturnPointDTO returnPoint) throws WorkflowException; | |
237 | ||
238 | /** | |
239 | * @param annotation | |
240 | * @param destRouteLevel | |
241 | * @throws WorkflowException | |
242 | * @throws InvalidActionTakenException | |
243 | * @throws ResourceUnavailableException | |
244 | */ | |
245 | public abstract void returnToPreviousRouteLevel(String annotation, Integer destRouteLevel) throws WorkflowException; | |
246 | ||
247 | public abstract void logDocumentAction(String annotation) throws WorkflowException; | |
248 | ||
249 | /** | |
250 | * Indicates if the document is in the initated state or not. | |
251 | * | |
252 | * @return true if in the specified state | |
253 | */ | |
254 | public abstract boolean stateIsInitiated(); | |
255 | ||
256 | /** | |
257 | * Indicates if the document is in the saved state or not. | |
258 | * | |
259 | * @return true if in the specified state | |
260 | */ | |
261 | public abstract boolean stateIsSaved(); | |
262 | ||
263 | /** | |
264 | * Indicates if the document is in the enroute state or not. | |
265 | * | |
266 | * @return true if in the specified state | |
267 | */ | |
268 | public abstract boolean stateIsEnroute(); | |
269 | ||
270 | ||
271 | /** | |
272 | * Indicates if the document is in the final state or not. | |
273 | * | |
274 | * @return true if in the specified state | |
275 | */ | |
276 | public abstract boolean stateIsFinal(); | |
277 | ||
278 | /** | |
279 | * Indicates if the document is in the exception state or not. | |
280 | * | |
281 | * @return true if in the specified state | |
282 | */ | |
283 | public abstract boolean stateIsException(); | |
284 | ||
285 | /** | |
286 | * Indicates if the document is in the canceled state or not. | |
287 | * | |
288 | * @return true if in the specified state | |
289 | */ | |
290 | public abstract boolean stateIsCanceled(); | |
291 | ||
292 | /** | |
293 | * Indicates if the document is in the disapproved state or not. | |
294 | * | |
295 | * @return true if in the specified state | |
296 | */ | |
297 | public abstract boolean stateIsDisapproved(); | |
298 | ||
299 | /** | |
300 | * Indicates if the document is in the approved state or not. Will answer true is document is in Processed or Finalized state. | |
301 | * | |
302 | * @return true if in the specified state | |
303 | */ | |
304 | public abstract boolean stateIsApproved(); | |
305 | ||
306 | /** | |
307 | * Indicates if the document is in the processed state or not. | |
308 | * | |
309 | * @return true if in the specified state | |
310 | */ | |
311 | public abstract boolean stateIsProcessed(); | |
312 | ||
313 | public abstract String getStatusDisplayValue(); | |
314 | ||
315 | public abstract Timestamp getCreateDate(); | |
316 | ||
317 | ||
318 | /** | |
319 | * Returns true if the principalName of the given KualiUser matches the initiatorNetworkId of this document | |
320 | * | |
321 | * @param user | |
322 | * @return true if the given user is the initiator of this document | |
323 | */ | |
324 | public boolean userIsInitiator(Person user); | |
325 | ||
326 | /** | |
327 | * Returns true if the principalName of the given KualiUser matches the routedByUserNetworkId of this document | |
328 | * | |
329 | * @param user | |
330 | * @return true if the given user is the user who routed this document | |
331 | */ | |
332 | public boolean userIsRoutedByUser(Person user); | |
333 | ||
334 | /** | |
335 | * Returns the names of the nodes that the document is currently at. | |
336 | */ | |
337 | public String[] getNodeNames() throws WorkflowException; | |
338 | ||
339 | /** | |
340 | * Returns the current node names of the document delimited by the constant: | |
341 | * {@link DocumentRouteHeaderValue#CURRENT_ROUTE_NODE_NAME_DELIMITER} | |
342 | */ | |
343 | public String getCurrentRouteNodeNames(); | |
344 | ||
345 | /** | |
346 | * This method returns a set of all approvers of this document. | |
347 | * | |
348 | * @return a set of all approvers | |
349 | */ | |
350 | public Set<Person> getAllPriorApprovers() throws WorkflowException; | |
351 | ||
352 | public void setReceiveFutureRequests() throws WorkflowException; | |
353 | ||
354 | public void setDoNotReceiveFutureRequests() throws WorkflowException; | |
355 | ||
356 | public void setClearFutureRequests() throws WorkflowException; | |
357 | } |