Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
WorkflowDocumentActionsService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2011 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/ecl1.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.kew.api.action; | |
17 | ||
18 | import java.util.List; | |
19 | import java.util.Set; | |
20 | ||
21 | import javax.jws.WebMethod; | |
22 | import javax.jws.WebParam; | |
23 | import javax.jws.WebResult; | |
24 | import javax.jws.WebService; | |
25 | import javax.jws.soap.SOAPBinding; | |
26 | import javax.xml.bind.annotation.XmlElement; | |
27 | import javax.xml.bind.annotation.XmlElementWrapper; | |
28 | ||
29 | import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; | |
30 | import org.kuali.rice.kew.api.KewApiConstants; | |
31 | import org.kuali.rice.kew.api.WorkflowDocument; | |
32 | import org.kuali.rice.kew.api.doctype.IllegalDocumentTypeException; | |
33 | import org.kuali.rice.kew.api.document.Document; | |
34 | import org.kuali.rice.kew.api.document.DocumentContentUpdate; | |
35 | import org.kuali.rice.kew.api.document.DocumentStatus; | |
36 | import org.kuali.rice.kew.api.document.DocumentUpdate; | |
37 | import org.kuali.rice.kew.api.document.InvalidDocumentContentException; | |
38 | import org.kuali.rice.kew.api.document.RouteNodeInstance; | |
39 | import org.kuali.rice.kew.api.document.WorkflowAttributeDefinition; | |
40 | import org.kuali.rice.kew.api.document.WorkflowAttributeValidationError; | |
41 | import org.kuali.rice.kew.api.document.WorkflowDocumentService; | |
42 | ||
43 | /** | |
44 | * This service defines various operations which are used to perform actions against a workflow | |
45 | * {@link Document}. These actions include creation, routing, approval, acknowledgment, saving, | |
46 | * updating document data, etc. | |
47 | * | |
48 | * <p> | |
49 | * It also includes operations that allow for loading of information about which actions a given | |
50 | * principal is permitted to execute against a given document ({@link ValidActions}), as well as | |
51 | * providing information about what actions a particular principal has been requested to execute | |
52 | * against a given document ({@link RequestedActions}). | |
53 | * | |
54 | * <p> | |
55 | * This service can be used in conjunction with the {@link WorkflowDocumentService} which provides | |
56 | * additional operations that relate to documents (but not document actions). | |
57 | * | |
58 | * <p> | |
59 | * Unless otherwise specified, all parameters to all methods must not be null. If the argument is a | |
60 | * string value it must also not be "blank" (either the empty string or a string of only | |
61 | * whitespace). In the cases where this is violated, a {@link RiceIllegalArgumentException} will be | |
62 | * thrown. Additionally, unless otherwise specified, all methods will return non-null return values. | |
63 | * In the case of collections, an empty collection will be returned in preference to a null | |
64 | * collection value. All collections which are returned from methods on this service will be | |
65 | * unmodifiable collections. | |
66 | * | |
67 | * <p> | |
68 | * Many of the actions trigger processing by the workflow engine. Unless otherwise specified, any | |
69 | * method on this service which performs an action against the document will also submit the | |
70 | * document to the workflow engine after performing the action. This may trigger the workflow | |
71 | * document to transition to the next node in the workflow process or activate additional action | |
72 | * requests depending on what the current state of the active node instance(s) is on the document. | |
73 | * | |
74 | * <p> | |
75 | * Workflow engine processing may happen either asynchronously or synchronously depending on | |
76 | * configuration and capabilities of the back end workflow engine implementation. However, | |
77 | * asynchronous operation is suggested for most use cases. This means that when operating in | |
78 | * asynchronous mode, after an action is submitted against the document there may be a delay in | |
79 | * state changes to the document. For example, if a principal submits an approve against a document | |
80 | * that triggers transition to the next node in the workflow process (generating new action requests | |
81 | * in the process) those new actions requests will not be represented in the information returned in | |
82 | * the {@link DocumentActionResult} result object. Though future invocations of | |
83 | * {@link #determineRequestedActions(String, String)} and similar methods may yield such | |
84 | * information, though it may do so after an non-deterministic amount of time since the workflow | |
85 | * engine makes no guarantees about how quickly it will complete processing. Additionally, | |
86 | * asynchronous workflow processing is scheduled in a work queue and therefore it may not be picked | |
87 | * up for processing immediately depending on system load and other factors. | |
88 | * | |
89 | * <p> | |
90 | * If there is an error during asynchronous workflow processing then the document will be put into | |
91 | * exception routing (which can be executed in various ways depending on how the document type | |
92 | * defines it's exception policy). Regardless of the exact process that gets triggered during | |
93 | * exception routing, the end result is a set of {@link ActionRequestType#COMPLETE} requests to | |
94 | * those principals who are capable of resolving the exception scenario as well as the document's | |
95 | * status being transitioned to {@link DocumentStatus#EXCEPTION}. Once they have resolved any | |
96 | * barriers to successful processing of the document, they can take the | |
97 | * {@link #complete(DocumentActionParameters)} action against the document in order to satisfy the | |
98 | * outstanding exception request(s) and send the document back through the workflow engine. | |
99 | * | |
100 | * <p> | |
101 | * In contrast, when operating the workflow engine in synchronous mode, processing will happen | |
102 | * immediately and control will not be returned to the caller until all outstanding processing has | |
103 | * completed. As a result, the information returned in the {@link DocumentActionResult} will always | |
104 | * be in a consistent state after each action is performed. When operating in synchronous mode, the | |
105 | * process of exception routing does not occur when failures are encountered during workflow engine | |
106 | * processing, rather any exceptions that are raised during processing will instead be thrown back | |
107 | * to the calling code. | |
108 | * | |
109 | * <p> | |
110 | * Implementations of this service are required to be thread-safe and should be able to be invoked | |
111 | * either locally or remotely. | |
112 | * | |
113 | * @see WorkflowDocumentService | |
114 | * @see WorkflowDocument | |
115 | * | |
116 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
117 | * | |
118 | */ | |
119 | @WebService(name = "workflowDocumentActionsServiceSoap", targetNamespace = KewApiConstants.Namespaces.KEW_NAMESPACE_2_0) | |
120 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
121 | public interface WorkflowDocumentActionsService { | |
122 | ||
123 | /** | |
124 | * Creates a new document instance from the given document type. The initiator of the resulting | |
125 | * document will be the same as the initiator that is passed to this method. Optional | |
126 | * {@link DocumentUpdate} and {@link DocumentContentUpdate} parameters can be supplied in order | |
127 | * to create the document with these additional pieces of data already set. | |
128 | * | |
129 | * <p> | |
130 | * By default, if neither the {@link DocumentUpdate} or {@link DocumentContentUpdate} is passed | |
131 | * to this method, the document that is created and returned from this operation will have the | |
132 | * following initial state: | |
133 | * | |
134 | * <ul> | |
135 | * <ol> | |
136 | * {@code status} set to {@link DocumentStatus#INITIATED} | |
137 | * </ol> | |
138 | * <ol> | |
139 | * {@code createDate} and {@code dateLastModified} set to the current date and time | |
140 | * </ol> | |
141 | * <ol> | |
142 | * {@code current} set to 'true' | |
143 | * </ol> | |
144 | * <ol> | |
145 | * {@code documentContent} set to the default and empty content | |
146 | * </ol> | |
147 | * </ul> | |
148 | * | |
149 | * <p> | |
150 | * Additionally, the initial {@link RouteNodeInstance} for the workflow process on the document | |
151 | * will be created and linked to the document as it's initial node. Once the document is | |
152 | * created, the {@link #route(DocumentActionParameters)} operation must be invoked in order to | |
153 | * submit it to the workflow engine for initial processing. | |
154 | * | |
155 | * <p> | |
156 | * In certain situations, the given principal may not be permitted to initiate documents of the | |
157 | * given type. In these cases an {@link InvalidActionTakenException} will be thrown. | |
158 | * | |
159 | * @param documentTypeName the name of the document type from which to create this document | |
160 | * @param initiatorPrincipalId the id of the principal who is initiating this document | |
161 | * @param documentUpdate specifies additional document to set on the document upon creation, | |
162 | * this is optional and if null is passed then the document will be created with the | |
163 | * default document state | |
164 | * @param documentContentUpdate defines what the initial document content for the document | |
165 | * should be, this is optional if null is passed then the document will be created with | |
166 | * the default empty document content | |
167 | * | |
168 | * @return the document that was created | |
169 | * | |
170 | * @throws RiceIllegalArgumentException if {@code principalId} is null or blank | |
171 | * @throws RiceIllegalArgumentException if {@code principalId} does not identify a valid | |
172 | * principal | |
173 | * @throws RiceIllegalArgumentException if {@code documentTypeName} is null or blank | |
174 | * @throws RiceIllegalArgumentException if {@code documentTypeName} does not identify an | |
175 | * existing document type | |
176 | * @throws IllegalDocumentTypeException if the specified document type is not active | |
177 | * @throws IllegalDocumentTypeException if the specified document type does not support document | |
178 | * creation (in other words, it's a document type that is only used as a parent) | |
179 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
180 | * action | |
181 | */ | |
182 | @WebMethod(operationName = "create") | |
183 | @WebResult(name = "document") | |
184 | @XmlElement(name = "document", required = true) | |
185 | Document create( | |
186 | @WebParam(name = "documentTypeName") String documentTypeName, | |
187 | @WebParam(name = "initiatorPrincipalId") String initiatorPrincipalId, | |
188 | @WebParam(name = "documentUpdate") DocumentUpdate documentUpdate, | |
189 | @WebParam(name = "documentContentUpdate") DocumentContentUpdate documentContentUpdate) | |
190 | throws RiceIllegalArgumentException, IllegalDocumentTypeException, InvalidActionTakenException; | |
191 | ||
192 | /** | |
193 | * Determines which actions against the document with the given id are valid for the principal | |
194 | * with the given id. | |
195 | * | |
196 | * @param documentId the id of the document for which to determine valid actions | |
197 | * @param principalId the id of the principal for which to determine valid actions against the | |
198 | * given document | |
199 | * | |
200 | * @return a {@link ValidActions} object which contains the valid actions for the given | |
201 | * principal against the given document | |
202 | * | |
203 | * @throws RiceIllegalArgumentException if {@code documentId} is null or blank | |
204 | * @throws RiceIllegalArgumentException if document with the given {@code documentId} does not | |
205 | * exist | |
206 | * @throws RiceIllegalArgumentException if {@code principalId} is null or blank | |
207 | * @throws RiceIllegalArgumentException if principal with the given {@code principalId} does not | |
208 | * exist | |
209 | */ | |
210 | @WebMethod(operationName = "determineValidActions") | |
211 | @WebResult(name = "validActions") | |
212 | @XmlElement(name = "validActions", required = true) | |
213 | ValidActions determineValidActions( | |
214 | @WebParam(name = "documentId") String documentId, | |
215 | @WebParam(name = "principalId") String principalId) | |
216 | throws RiceIllegalArgumentException; | |
217 | ||
218 | /** | |
219 | * Determines which actions are requested against the document with the given id for the | |
220 | * principal with the given id. These are generally derived based on action requests that are | |
221 | * currently pending against the document. | |
222 | * | |
223 | * <p> | |
224 | * This method is distinguished from {@link #determineValidActions(String, String)} in that fact | |
225 | * that valid actions are the actions that the principal is permitted to take, while requested | |
226 | * actions are those that the principal is specifically being asked to take. Note that the | |
227 | * actions that are requested are used when assembling valid actions but are not necessarily the | |
228 | * only authoritative source for determination of valid actions for the principal, as | |
229 | * permissions and other configuration can also come into play. | |
230 | * | |
231 | * @param documentId the id of the document for which to determine requested actions | |
232 | * @param principalId the id of the principal for which to determine requested actions against | |
233 | * the given document | |
234 | * | |
235 | * @return a {@link RequestedActions} object which contains the actions that are being requested | |
236 | * from the given principal against the given document | |
237 | * | |
238 | * @throws RiceIllegalArgumentException if {@code documentId} is null or blank | |
239 | * @throws RiceIllegalArgumentException if document with the given {@code documentId} does not | |
240 | * exist | |
241 | * @throws RiceIllegalArgumentException if {@code principalId} is null or blank | |
242 | * @throws RiceIllegalArgumentException if principal with the given {@code principalId} does not | |
243 | * exist | |
244 | */ | |
245 | @WebMethod(operationName = "determineRequestedActions") | |
246 | @WebResult(name = "requestedActions") | |
247 | @XmlElement(name = "requestedActions", required = true) | |
248 | RequestedActions determineRequestedActions( | |
249 | @WebParam(name = "documentId") String documentId, | |
250 | @WebParam(name = "principalId") String principalId) | |
251 | throws RiceIllegalArgumentException; | |
252 | ||
253 | /** | |
254 | * Executes an {@link ActionType#ACKNOWLEDGE} action for the given principal and document | |
255 | * specified in the supplied parameters. When a principal acknowledges a document, any of the | |
256 | * principal's pending action requests at or below the acknowledge level (which includes fyi | |
257 | * requests as well) will be satisfied by the principal's action. The principal's action should | |
258 | * be recorded with the document as an {@link ActionTaken}. | |
259 | * | |
260 | * <p> | |
261 | * Depending on document type policy, a pending action request at or below the acknowledge level | |
262 | * may have to exist on the document in order for the principal to take this action. Otherwise | |
263 | * an {@link InvalidActionTakenException} may be thrown. In order to determine if an acknowledge | |
264 | * action is valid, the {@link ValidActions} or {@link RequestedActions} for the document can be | |
265 | * checked. | |
266 | * | |
267 | * @param parameters the parameters which indicate which principal is executing the action | |
268 | * against which document, as well as additional operations to take against the document, | |
269 | * such as updating document data | |
270 | * | |
271 | * @return the result of executing the action, including a view on the updated state of the | |
272 | * document and related actions | |
273 | * | |
274 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
275 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
276 | * {@code parameters} exists | |
277 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
278 | * in {@code parameters} exists | |
279 | * @throws InvalidDocumentContentException if the document content on the | |
280 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
281 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
282 | * action | |
283 | */ | |
284 | @WebMethod(operationName = "acknowledge") | |
285 | @WebResult(name = "documentActionResult") | |
286 | @XmlElement(name = "documentActionResult", required = true) | |
287 | DocumentActionResult acknowledge(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
288 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
289 | ||
290 | /** | |
291 | * Executes an {@link ActionType#APPROVE} action for the given principal and document specified | |
292 | * in the supplied parameters. When a principal approves a document, any of the principal's | |
293 | * pending action requests at or below the approve level (which includes complete, acknowledge, | |
294 | * and fyi requests as well) will be satisfied by the principal's action. The principal's action | |
295 | * should be recorded with the document as an {@link ActionTaken}. | |
296 | * | |
297 | * <p> | |
298 | * Depending on document type policy, a pending action request at or below the approve level may | |
299 | * have to exist on the document in order for the principal to take this action. Otherwise an | |
300 | * {@link InvalidActionTakenException} may be thrown. In order to determine if an approve action | |
301 | * is valid, the {@link ValidActions} or {@link RequestedActions} for the document can be | |
302 | * checked. | |
303 | * | |
304 | * @param parameters the parameters which indicate which principal is executing the action | |
305 | * against which document, as well as additional operations to take against the document, | |
306 | * such as updating document data | |
307 | * | |
308 | * @return the result of executing the action, including a view on the updated state of the | |
309 | * document and related actions | |
310 | * | |
311 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
312 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
313 | * {@code parameters} exists | |
314 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
315 | * in {@code parameters} exists | |
316 | * @throws InvalidDocumentContentException if the document content on the | |
317 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
318 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
319 | * action | |
320 | */ | |
321 | @WebMethod(operationName = "approve") | |
322 | @WebResult(name = "documentActionResult") | |
323 | @XmlElement(name = "documentActionResult", required = true) | |
324 | DocumentActionResult approve(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
325 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
326 | ||
327 | /** | |
328 | * Executes an {@link ActionType#ADHOC_REQUEST} action for the given principal and document | |
329 | * specified in the supplied parameters to create an ad hoc action request to the target | |
330 | * principal specified in the {@code AdHocToPrincipal}. | |
331 | * | |
332 | * <p> | |
333 | * Operates as per {@link #adHocToGroup(DocumentActionParameters, AdHocToGroup)} with the | |
334 | * exception that this method is used to send an adhoc request to principal instead of a group. | |
335 | * | |
336 | * <p> | |
337 | * Besides this difference, the same rules that are in play for sending ad hoc requests to group | |
338 | * apply for sending ad hoc requests to principals. | |
339 | * | |
340 | * @param parameters the parameters which indicate which principal is executing the action | |
341 | * against which document, as well as additional operations to take against the document, | |
342 | * such as updating document data | |
343 | * @param adHocToPrincipal defines various pieces of information that informs what type of ad | |
344 | * hoc request should be created | |
345 | * | |
346 | * @return the result of executing the action, including a view on the updated state of the | |
347 | * document and related actions | |
348 | * | |
349 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
350 | * @throws RiceIllegalArgumentException if {@code adHocToPrincipal} is null | |
351 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
352 | * {@code parameters} exists | |
353 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
354 | * in {@code parameters} exists | |
355 | * @throws InvalidDocumentContentException if the document content on the | |
356 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
357 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
358 | * action | |
359 | * @throws InvalidActionTakenException if the target principal is not permitted to receive ad | |
360 | * hoc requests on documents of this type | |
361 | * @throws InvalidActionTakenException if the specified ad hoc request cannot be generated | |
362 | * because the current state of the document would result in an illegal request being | |
363 | * generated | |
364 | * | |
365 | * @see #adHocToGroup(DocumentActionParameters, AdHocToGroup) | |
366 | */ | |
367 | @WebMethod(operationName = "adHocToPrincipal") | |
368 | @WebResult(name = "documentActionResult") | |
369 | @XmlElement(name = "documentActionResult", required = true) | |
370 | DocumentActionResult adHocToPrincipal( | |
371 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
372 | @WebParam(name = "adHocToPrincipal") AdHocToPrincipal adHocToPrincipal) | |
373 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
374 | ||
375 | /** | |
376 | * Executes an {@link ActionType#ADHOC_REQUEST} action for the given group and document | |
377 | * specified in the supplied parameters to create an ad hoc action request to the target group | |
378 | * specified in the {@code AdHocToGroup}. The {@code AdHocToGroup} contains additional | |
379 | * information on how the ad hoc action request should be created, including the type of request | |
380 | * to generate, at which node it should generated, etc. | |
381 | * | |
382 | * <p> | |
383 | * The policy for how ad hoc actions handle request generation and interact with the workflow | |
384 | * engine is different depending on the state of the document when the request to generate the | |
385 | * ad hoc is submitted. There are also different scenarios under which certain types of ad hoc | |
386 | * actions are allowed to be executed (throwing {@link InvalidActionTakenException} in | |
387 | * situations where the actions are not permitted). The rules are defined as follows: | |
388 | * | |
389 | * <ol> | |
390 | * <li>If the status of the document is {@link DocumentStatus#INITIATED} then the action request | |
391 | * will be generated with a status of {@link ActionRequestStatus#INITIALIZED} and no processing | |
392 | * directives will be submitted to the workflow engine. When the document is routed, these ad | |
393 | * hoc requests will get activated</li> | |
394 | * <li>If the ad hoc request being created is an {@link ActionRequestType#COMPLETE} or | |
395 | * {@link ActionRequestType#APPROVE} and the document is in a "terminal" state (either | |
396 | * {@link DocumentStatus#CANCELED}, {@link DocumentStatus#DISAPPROVED}, | |
397 | * {@link DocumentStatus#PROCESSED}, {@link DocumentStatus#FINAL}) or is in | |
398 | * {@link DocumentStatus#EXCEPTION} status, then an {@link InvalidActionTakenException} will be | |
399 | * thrown. This is because submitting such an action with a document in that state would result | |
400 | * in creation of an illegal action request.</li> | |
401 | * <li>If the document is in a "terminal" state (see above for definition) then the request will | |
402 | * be immediately (and synchronously) activated.</li> | |
403 | * <li>Otherwise, after creating the ad hoc request it will be in the | |
404 | * {@link ActionRequestStatus#INITIALIZED} status, and the document will be immediately | |
405 | * forwarded to the workflow engine for processing at which point the ad hoc request will | |
406 | * activated at the appropriate time.</li> | |
407 | * </ol> | |
408 | * | |
409 | * <p> | |
410 | * Unlink other actions, ad hoc actions don't result in the recording of an {@link ActionTaken} | |
411 | * against the document. Instead, only the requested ad hoc {@link ActionRequest} is created. | |
412 | * | |
413 | * @param parameters the parameters which indicate which principal is executing the action | |
414 | * against which document, as well as additional operations to take against the document, | |
415 | * such as updating document data | |
416 | * @param adHocToGroup defines various pieces of information that informs what type of ad hoc | |
417 | * request should be created | |
418 | * | |
419 | * @return the result of executing the action, including a view on the updated state of the | |
420 | * document and related actions | |
421 | * | |
422 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
423 | * @throws RiceIllegalArgumentException if {@code adHocToGroup} is null | |
424 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
425 | * {@code parameters} exists | |
426 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
427 | * in {@code parameters} exists | |
428 | * @throws InvalidDocumentContentException if the document content on the | |
429 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
430 | * @throws InvalidActionTakenException if the supplied principals i is not allowed to execute | |
431 | * this action | |
432 | * @throws InvalidActionTakenException if any of the principals in the target group are not | |
433 | * permitted to receive ad hoc requests on documents of this type | |
434 | * @throws InvalidActionTakenException if the specified ad hoc request cannot be generated | |
435 | * because the current state of the document would result in an illegal request being | |
436 | * generated | |
437 | */ | |
438 | @WebMethod(operationName = "adHocToGroup") | |
439 | @WebResult(name = "documentActionResult") | |
440 | @XmlElement(name = "documentActionResult", required = true) | |
441 | DocumentActionResult adHocToGroup( | |
442 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
443 | @WebParam(name = "adHocToGroup") AdHocToGroup adHocToGroup) | |
444 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
445 | ||
446 | /** | |
447 | * Executes an {@link ActionType#ADHOC_REQUEST_REVOKE} action for the given principal and | |
448 | * document specified in the supplied parameters against the action request with the given id. | |
449 | * The process of revoking an ad hoc request simply deactivates the request associating the | |
450 | * generated {@link ActionTaken} of the revoke action with the deactivated request (this allows | |
451 | * for it to be determined what caused the ad hoc request to be deactivated). As with other | |
452 | * actions, this action taken is then recorded with the document. | |
453 | * | |
454 | * @param parameters the parameters which indicate which principal is executing the action | |
455 | * against which document, as well as additional operations to take against the document, | |
456 | * such as updating document data | |
457 | * @param actionRequestId the id of the action request to revoke | |
458 | * | |
459 | * @return the result of executing the action, including a view on the updated state of the | |
460 | * document and related actions | |
461 | * | |
462 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
463 | * @throws RiceIllegalArgumentException if {@code actionRequestId} is null or blank | |
464 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
465 | * {@code parameters} exists | |
466 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
467 | * in {@code parameters} exists | |
468 | * @throws InvalidDocumentContentException if the document content on the | |
469 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
470 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
471 | * action | |
472 | * @throws InvalidActionTakenException if a pending ad hoc request with the given | |
473 | * {@code actionRequestId} does not exist on the specified document, this could mean | |
474 | * that the action request id is invalid, or that the action request has already been | |
475 | * deactivated and is no longer pending | |
476 | */ | |
477 | @WebMethod(operationName = "revokeAdHocRequestById") | |
478 | @WebResult(name = "documentActionResult") | |
479 | @XmlElement(name = "documentActionResult", required = true) | |
480 | DocumentActionResult revokeAdHocRequestById( | |
481 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
482 | @WebParam(name = "actionRequestId") String actionRequestId) | |
483 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
484 | ||
485 | /** | |
486 | * Executes an {@link ActionType#ADHOC_REQUEST_REVOKE} action which revokes all pending ad hoc | |
487 | * action requests that match the supplied {@link AdHocRevoke} criteria for the given principal | |
488 | * and document specified in the supplied parameters. The process of revoking an ad hoc requests | |
489 | * simply deactivates all ad hoc requests that match the given {@code AdHocRevoke} criteria, | |
490 | * associating the generated {@link ActionTaken} of the revoke action with the deactivated | |
491 | * requests (this allows for it to be determined what caused the ad hoc request to be | |
492 | * deactivated). As with other actions, this action taken is then recorded with the document. | |
493 | * | |
494 | * <p> | |
495 | * It's possible that the given ad hoc revoke command will match no action requests on the | |
496 | * document, in which case this method will complete successfully but no requests will be | |
497 | * deactivated. | |
498 | * | |
499 | * @param parameters the parameters which indicate which principal is executing the action | |
500 | * against which document, as well as additional operations to take against the document, | |
501 | * such as updating document data | |
502 | * @param revoke the criteria for matching ad hoc action requests on the specified document that | |
503 | * should be revoked | |
504 | * | |
505 | * @return the result of executing the action, including a view on the updated state of the | |
506 | * document and related actions | |
507 | * | |
508 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
509 | * @throws RiceIllegalArgumentException if {@code revoke} is null | |
510 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
511 | * {@code parameters} exists | |
512 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
513 | * in {@code parameters} exists | |
514 | * @throws InvalidDocumentContentException if the document content on the | |
515 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
516 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
517 | * action | |
518 | */ | |
519 | @WebMethod(operationName = "revokeAdHocRequests") | |
520 | @WebResult(name = "documentActionResult") | |
521 | @XmlElement(name = "documentActionResult", required = true) | |
522 | DocumentActionResult revokeAdHocRequests( | |
523 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
524 | @WebParam(name = "revoke") AdHocRevoke revoke) | |
525 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
526 | ||
527 | /** | |
528 | * Executes an {@link ActionType#ADHOC_REQUEST_REVOKE} action which revokes all pending ad hoc | |
529 | * action requests for the given principal and document specified in the supplied parameters. | |
530 | * This process of revoking all ad hoc requests will simply deactivate all ad hoc requests on | |
531 | * the specified document, associating the generated {@link ActionTaken} of the revoke action | |
532 | * with the deactivated requests (this allows for it to be determined what caused the ad hoc | |
533 | * request to be deactivated). As with other actions, this action taken is then recorded with | |
534 | * the document. | |
535 | * | |
536 | * <p> | |
537 | * It's possible that the specified document will have no pending adhoc requests, in which case | |
538 | * this method will complete successfully but no requests will be deactivated. | |
539 | * | |
540 | * @param parameters the parameters which indicate which principal is executing the action | |
541 | * against which document, as well as additional operations to take against the document, | |
542 | * such as updating document data | |
543 | * | |
544 | * @return the result of executing the action, including a view on the updated state of the | |
545 | * document and related actions | |
546 | * | |
547 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
548 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
549 | * {@code parameters} exists | |
550 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
551 | * in {@code parameters} exists | |
552 | * @throws InvalidDocumentContentException if the document content on the | |
553 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
554 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
555 | * action | |
556 | */ | |
557 | @WebMethod(operationName = "revokeAllAdHocRequests") | |
558 | @WebResult(name = "documentActionResult") | |
559 | @XmlElement(name = "documentActionResult", required = true) | |
560 | DocumentActionResult revokeAllAdHocRequests(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
561 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
562 | ||
563 | /** | |
564 | * Executes a {@link ActionType#CANCEL} action for the given principal and document specified in | |
565 | * the supplied parameters. When a principal cancels a document, all pending action requests on | |
566 | * the document are deactivated and the the principal's action will be recorded on the document | |
567 | * as an {@link ActionTaken}. Additionally, the document will be (synchronously) transitioned to | |
568 | * the {@link DocumentStatus#CANCELED} status. | |
569 | * | |
570 | * <p> | |
571 | * In order to cancel a document, the principal must have permission to cancel documents of the | |
572 | * appropriate type, and one of the following must hold true: | |
573 | * | |
574 | * <ol> | |
575 | * <li>The document must have a status of {@link DocumentStatus#INITIATED} <strong>or</strong></li> | |
576 | * <li>The document must have a status of {@link DocumentStatus#SAVED} <strong>or</strong></li> | |
577 | * <li>The principal must have a pending "complete" or "approve" request on the document. | |
578 | * | |
579 | * @param parameters the parameters which indicate which principal is executing the action | |
580 | * against which document, as well as additional operations to take against the document, | |
581 | * such as updating document data | |
582 | * | |
583 | * @return the result of executing the action, including a view on the updated state of the | |
584 | * document and related actions | |
585 | * | |
586 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
587 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
588 | * {@code parameters} exists | |
589 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
590 | * in {@code parameters} exists | |
591 | * @throws InvalidDocumentContentException if the document content on the | |
592 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
593 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
594 | * action | |
595 | */ | |
596 | @WebMethod(operationName = "cancel") | |
597 | @WebResult(name = "documentActionResult") | |
598 | @XmlElement(name = "documentActionResult", required = true) | |
599 | DocumentActionResult cancel(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
600 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
601 | ||
602 | /** | |
603 | * Executes an {@link ActionType#FYI} action for the given principal and document specified in | |
604 | * the supplied parameters. When a principal clears fyis on a document, any of the principal's | |
605 | * pending fyis will be satisfied by the principal's action. The principal's action should be | |
606 | * recorded with the document as an {@link ActionTaken}. | |
607 | * | |
608 | * <p> | |
609 | * Depending on document type policy, a pending fyi request may have to exist on the document in | |
610 | * order for the principal to take this action. Otherwise an {@link InvalidActionTakenException} | |
611 | * may be thrown. In order to determine if an fyi action is valid, the {@link ValidActions} or | |
612 | * {@link RequestedActions} for the document can be checked. | |
613 | * | |
614 | * @param parameters the parameters which indicate which principal is executing the action | |
615 | * against which document, as well as additional operations to take against the document, | |
616 | * such as updating document data | |
617 | * | |
618 | * @return the result of executing the action, including a view on the updated state of the | |
619 | * document and related actions | |
620 | * | |
621 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
622 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
623 | * {@code parameters} exists | |
624 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
625 | * in {@code parameters} exists | |
626 | * @throws InvalidDocumentContentException if the document content on the | |
627 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
628 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
629 | * action | |
630 | */ | |
631 | @WebMethod(operationName = "clearFyi") | |
632 | @WebResult(name = "documentActionResult") | |
633 | @XmlElement(name = "documentActionResult", required = true) | |
634 | DocumentActionResult clearFyi(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
635 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
636 | ||
637 | /** | |
638 | * Executes an {@link ActionType#COMPLETE} action for the given principal and document specified | |
639 | * in the supplied parameters. When a principal completes a document, any of the principal's | |
640 | * pending action requests at or below the complete level (which includes approve, acknowledge, | |
641 | * and fyi requests as well) will be satisfied by the principal's action. The principal's action | |
642 | * should be recorded with the document as an {@link ActionTaken}. | |
643 | * | |
644 | * <p> | |
645 | * Depending on document type policy, a pending action request at or below the complete level | |
646 | * may have to exist on the document in order for the principal to take this action. Otherwise | |
647 | * an {@link InvalidActionTakenException} may be thrown. In order to determine if an complete | |
648 | * action is valid, the {@link ValidActions} or {@link RequestedActions} for the document can be | |
649 | * checked. | |
650 | * | |
651 | * @param parameters the parameters which indicate which principal is executing the action | |
652 | * against which document, as well as additional operations to take against the document, | |
653 | * such as updating document data | |
654 | * | |
655 | * @return the result of executing the action, including a view on the updated state of the | |
656 | * document and related actions | |
657 | * | |
658 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
659 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
660 | * {@code parameters} exists | |
661 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
662 | * in {@code parameters} exists | |
663 | * @throws InvalidDocumentContentException if the document content on the | |
664 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
665 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
666 | * action | |
667 | */ | |
668 | @WebMethod(operationName = "complete") | |
669 | @WebResult(name = "documentActionResult") | |
670 | @XmlElement(name = "documentActionResult", required = true) | |
671 | DocumentActionResult complete(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
672 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
673 | ||
674 | /** | |
675 | * Executes a {@link ActionType#DISAPPROVE} action for the given principal and document | |
676 | * specified in the supplied parameters. When a principal disapproves a document, all pending | |
677 | * action requests on the document are deactivated and the the principal's action will be | |
678 | * recorded on the document as an {@link ActionTaken}. Additionally, the document will be | |
679 | * (synchronously) transitioned to the {@link DocumentStatus#DISAPPROVED} status. | |
680 | * | |
681 | * <p> | |
682 | * Depending on document type policy and configuration, notifications may be sent to past | |
683 | * approvers of the document. By default, an "acknowledge" request will be sent to each | |
684 | * principal who took an "approve" or "complete" action on the document previously. | |
685 | * | |
686 | * <p> | |
687 | * In order to disapprove a document, the principal must have a pending approve or complete | |
688 | * request on the document. | |
689 | * | |
690 | * @param parameters the parameters which indicate which principal is executing the action | |
691 | * against which document, as well as additional operations to take against the document, | |
692 | * such as updating document data | |
693 | * | |
694 | * @return the result of executing the action, including a view on the updated state of the | |
695 | * document and related actions | |
696 | * | |
697 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
698 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
699 | * {@code parameters} exists | |
700 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
701 | * in {@code parameters} exists | |
702 | * @throws InvalidDocumentContentException if the document content on the | |
703 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
704 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
705 | * action | |
706 | */ | |
707 | @WebMethod(operationName = "disapprove") | |
708 | @WebResult(name = "documentActionResult") | |
709 | @XmlElement(name = "documentActionResult", required = true) | |
710 | DocumentActionResult disapprove(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
711 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
712 | ||
713 | /** | |
714 | * Submits a document that is in either the "initiated" or "saved" state to the workflow engine | |
715 | * for processing. The route action triggers the beginning of the routing process and | |
716 | * (synchronously) switches the status of the document to {@link DocumentStatus#ENROUTE}. It | |
717 | * then queues up a request to the workflow engine to process the document. | |
718 | * | |
719 | * <p> | |
720 | * When the route action is executed, an {@link ActionType#COMPLETE} action is recorded on the | |
721 | * document for the principal who executed the route action. At this point in time, any action | |
722 | * requests that are currently on the document in an "initialized" state will be activated. | |
723 | * Requests of this nature can commonly exist if ad hoc requests have been attached to the | |
724 | * document prior to execution of the route action. | |
725 | * | |
726 | * <p> | |
727 | * By default, the principal who initiated the document is the same principal who must submit | |
728 | * the route command. However, a document type policy can be set which will relax this | |
729 | * constraint. | |
730 | * | |
731 | * <p> | |
732 | * The route action should ideally only ever be executed once for a given document. Depending on | |
733 | * document type policy, attempting to execute a "route" action against a document which is | |
734 | * already enroute or in a terminal state may result in an {@link InvalidActionTakenException} | |
735 | * being thrown. | |
736 | * | |
737 | * @param parameters the parameters which indicate which principal is executing the action | |
738 | * against which document, as well as additional operations to take against the document, | |
739 | * such as updating document data | |
740 | * | |
741 | * @return the result of executing the action, including a view on the updated state of the | |
742 | * document and related actions | |
743 | * | |
744 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
745 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
746 | * {@code parameters} exists | |
747 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
748 | * in {@code parameters} exists | |
749 | * @throws InvalidDocumentContentException if the document content on the | |
750 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
751 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
752 | * action | |
753 | */ | |
754 | @WebMethod(operationName = "route") | |
755 | @WebResult(name = "documentActionResult") | |
756 | @XmlElement(name = "documentActionResult", required = true) | |
757 | DocumentActionResult route(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
758 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
759 | ||
760 | /** | |
761 | * Triggers the execution of a full {@link ActionType#BLANKET_APPROVE} action for the given | |
762 | * principal and document specified in the supplied parameters. Blanket approval will | |
763 | * orchestrate a document from it's current node all the way to the end of the document's | |
764 | * workflow process. During this process, it will automatically act on all "approve" and | |
765 | * "complete" requests, effectively bypassing them. When it does this, it will notify the | |
766 | * original recipients of these requests by routing acknowledge requests to them. | |
767 | * | |
768 | * <p> | |
769 | * Blanket approve processing is handled by a special mode of the workflow engine which runs the | |
770 | * document through it's full processing lifecycle, ensuring that it makes it's way to the end | |
771 | * of it's route path (by bypassing any steps that would cause the process to halt, such as | |
772 | * approval requests). Because of this nature, blanket approve processing behavior is governed | |
773 | * by the same configuration as the rest of the workflow engine. So depending on whether the | |
774 | * engine is configured or synchronous or asynchronous operation, the blanket approve processing | |
775 | * will behave in the same manner. | |
776 | * | |
777 | * <p> | |
778 | * In order to execute a blanket approve operation, the principal must have permissions to do | |
779 | * so. | |
780 | * | |
781 | * @param parameters the parameters which indicate which principal is executing the action | |
782 | * against which document, as well as additional operations to take against the document, | |
783 | * such as updating document data | |
784 | * | |
785 | * @return the result of executing the action, including a view on the updated state of the | |
786 | * document and related actions | |
787 | * | |
788 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
789 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
790 | * {@code parameters} exists | |
791 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
792 | * in {@code parameters} exists | |
793 | * @throws InvalidDocumentContentException if the document content on the | |
794 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
795 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
796 | * action | |
797 | */ | |
798 | @WebMethod(operationName = "blanketApprove") | |
799 | @WebResult(name = "documentActionResult") | |
800 | @XmlElement(name = "documentActionResult", required = true) | |
801 | DocumentActionResult blanketApprove(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
802 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
803 | ||
804 | /** | |
805 | * Triggers the execution of a {@link ActionType#BLANKET_APPROVE} action which orchestrates the | |
806 | * document to the given set of node names for the given principal and document specified in the | |
807 | * supplied parameters. This method functions the same as | |
808 | * {@link #blanketApprove(DocumentActionParameters)} with the exception that the blanket approve | |
809 | * process will be halted once all node names in the given set have been reached. | |
810 | * | |
811 | * <p> | |
812 | * If null or an empty set is passed for {@code nodeNames} on this method, it's behavior will be | |
813 | * equivalent to {@link #blanketApprove(DocumentActionParameters)}. | |
814 | * | |
815 | * @param parameters the parameters which indicate which principal is executing the action | |
816 | * against which document, as well as additional operations to take against the document, | |
817 | * such as updating document data | |
818 | * @param nodeNames a set of node names to which to blanket approve the given document | |
819 | * | |
820 | * @return the result of executing the action, including a view on the updated state of the | |
821 | * document and related actions | |
822 | * | |
823 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
824 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
825 | * {@code parameters} exists | |
826 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
827 | * in {@code parameters} exists | |
828 | * @throws InvalidDocumentContentException if the document content on the | |
829 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
830 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
831 | * action | |
832 | */ | |
833 | @WebMethod(operationName = "blanketApproveToNodes") | |
834 | @WebResult(name = "documentActionResult") | |
835 | @XmlElement(name = "documentActionResult", required = true) | |
836 | DocumentActionResult blanketApproveToNodes( | |
837 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
838 | @WebParam(name = "nodeName") Set<String> nodeNames) | |
839 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
840 | ||
841 | /** | |
842 | * Triggers the execution of a {@link ActionType#RETURN_TO_PREVIOUS} action for the given | |
843 | * principal and document specified in the supplied parameters. Return a document to a previous | |
844 | * node will allow for the document to be pushed back to an earlier node in the process based on | |
845 | * the criteria present in the {@link ReturnPoint} that is passed to this method. | |
846 | * | |
847 | * <p> | |
848 | * The document is synchronously returned to the suggested return point (assuming the desired | |
849 | * return point can be identified for the given document), and then the document will be | |
850 | * submitted to the engine for further processing (effectively, re-establishing the flow of the | |
851 | * document from the target return point). | |
852 | * | |
853 | * <p> | |
854 | * Return the document to the first node in the document is treated as a special case and, | |
855 | * rather then transitioning the document back to the "initiated" status, will route a | |
856 | * "complete" request to the initiator of the document. The effectively enacts a return to the | |
857 | * document initiator in these cases. | |
858 | * | |
859 | * @param parameters the parameters which indicate which principal is executing the action | |
860 | * against which document, as well as additional operations to take against the document, | |
861 | * such as updating document data | |
862 | * | |
863 | * @return the result of executing the action, including a view on the updated state of the | |
864 | * document and related actions | |
865 | * | |
866 | * @throws RiceIllegalArgumentException if {@code parameters} is null | |
867 | * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in | |
868 | * {@code parameters} exists | |
869 | * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified | |
870 | * in {@code parameters} exists | |
871 | * @throws InvalidDocumentContentException if the document content on the | |
872 | * {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid. | |
873 | * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this | |
874 | * action | |
875 | */ | |
876 | @WebMethod(operationName = "returnToPreviousNode") | |
877 | @WebResult(name = "documentActionResult") | |
878 | @XmlElement(name = "documentActionResult", required = true) | |
879 | DocumentActionResult returnToPreviousNode( | |
880 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
881 | @WebParam(name = "returnPoint") ReturnPoint returnPoint) | |
882 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
883 | ||
884 | @WebMethod(operationName = "move") | |
885 | @WebResult(name = "documentActionResult") | |
886 | @XmlElement(name = "documentActionResult", required = true) | |
887 | DocumentActionResult move( | |
888 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
889 | @WebParam(name = "movePoint") MovePoint movePoint) | |
890 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
891 | ||
892 | @WebMethod(operationName = "takeGroupAuthority") | |
893 | @WebResult(name = "documentActionResult") | |
894 | @XmlElement(name = "documentActionResult", required = true) | |
895 | DocumentActionResult takeGroupAuthority( | |
896 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
897 | @WebParam(name = "groupId") String groupId) | |
898 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
899 | ||
900 | @WebMethod(operationName = "releaseGroupAuthority") | |
901 | @WebResult(name = "documentActionResult") | |
902 | @XmlElement(name = "documentActionResult", required = true) | |
903 | DocumentActionResult releaseGroupAuthority( | |
904 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
905 | @WebParam(name = "groupId") String groupId) | |
906 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
907 | ||
908 | @WebMethod(operationName = "save") | |
909 | @WebResult(name = "documentActionResult") | |
910 | @XmlElement(name = "documentActionResult", required = true) | |
911 | DocumentActionResult save(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
912 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
913 | ||
914 | /** | |
915 | * TODO - document the fact that passing an annotation to this will have no effect as it's not | |
916 | * actually recorded on the route log | |
917 | */ | |
918 | @WebMethod(operationName = "saveDocumentData") | |
919 | @WebResult(name = "documentActionResult") | |
920 | @XmlElement(name = "documentActionResult", required = true) | |
921 | DocumentActionResult saveDocumentData(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
922 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
923 | ||
924 | @WebMethod(operationName = "delete") | |
925 | @WebResult(name = "document") | |
926 | @XmlElement(name = "document", required = true) | |
927 | Document delete( | |
928 | @WebParam(name = "documentId") String documentId, | |
929 | @WebParam(name = "principalId") String principalId) | |
930 | throws RiceIllegalArgumentException, InvalidActionTakenException; | |
931 | ||
932 | @WebMethod(operationName = "logAnnotation") | |
933 | void logAnnotation( | |
934 | @WebParam(name = "documentId") String documentId, | |
935 | @WebParam(name = "principalId") String principalId, | |
936 | @WebParam(name = "annotation") String annotation) | |
937 | throws RiceIllegalArgumentException, InvalidActionTakenException; | |
938 | ||
939 | @WebMethod(operationName = "initiateIndexing") | |
940 | void initiateIndexing(@WebParam(name = "documentId") String documentId) | |
941 | throws RiceIllegalArgumentException; | |
942 | ||
943 | @WebMethod(operationName = "superUserBlanketApprove") | |
944 | @WebResult(name = "documentActionResult") | |
945 | @XmlElement(name = "documentActionResult", required = true) | |
946 | DocumentActionResult superUserBlanketApprove( | |
947 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
948 | @WebParam(name = "executePostProcessor") boolean executePostProcessor) | |
949 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
950 | ||
951 | @WebMethod(operationName = "superUserNodeApprove") | |
952 | @WebResult(name = "documentActionResult") | |
953 | @XmlElement(name = "documentActionResult", required = true) | |
954 | DocumentActionResult superUserNodeApprove( | |
955 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
956 | @WebParam(name = "executePostProcessor") boolean executePostProcessor, | |
957 | @WebParam(name = "nodeName") String nodeName) | |
958 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
959 | ||
960 | @WebMethod(operationName = "superUserTakeRequestedAction") | |
961 | @WebResult(name = "documentActionResult") | |
962 | @XmlElement(name = "documentActionResult", required = true) | |
963 | DocumentActionResult superUserTakeRequestedAction( | |
964 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
965 | @WebParam(name = "executePostProcessor") boolean executePostProcessor, | |
966 | @WebParam(name = "actionRequestId") String actionRequestId) | |
967 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
968 | ||
969 | @WebMethod(operationName = "superUserDisapprove") | |
970 | @WebResult(name = "documentActionResult") | |
971 | @XmlElement(name = "documentActionResult", required = true) | |
972 | DocumentActionResult superUserDisapprove( | |
973 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
974 | @WebParam(name = "executePostProcessor") boolean executePostProcessor) | |
975 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
976 | ||
977 | @WebMethod(operationName = "superUserCancel") | |
978 | @WebResult(name = "documentActionResult") | |
979 | @XmlElement(name = "documentActionResult", required = true) | |
980 | DocumentActionResult superUserCancel( | |
981 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
982 | @WebParam(name = "executePostProcessor") boolean executePostProcessor) | |
983 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
984 | ||
985 | @WebMethod(operationName = "superUserReturnToPreviousNode") | |
986 | @WebResult(name = "documentActionResult") | |
987 | @XmlElement(name = "documentActionResult", required = true) | |
988 | DocumentActionResult superUserReturnToPreviousNode( | |
989 | @WebParam(name = "parameters") DocumentActionParameters parameters, | |
990 | @WebParam(name = "executePostProcessor") boolean executePostProcessor, | |
991 | @WebParam(name = "returnPoint") ReturnPoint returnPoint) | |
992 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
993 | ||
994 | @WebMethod(operationName = "placeInExceptionRouting") | |
995 | @WebResult(name = "documentActionResult") | |
996 | @XmlElement(name = "documentActionResult", required = true) | |
997 | DocumentActionResult placeInExceptionRouting(@WebParam(name = "parameters") DocumentActionParameters parameters) | |
998 | throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException; | |
999 | ||
1000 | @WebMethod(operationName = "validateWorkflowAttributeDefinition") | |
1001 | @WebResult(name = "validationErrors") | |
1002 | @XmlElementWrapper(name = "validationErrors", required = true) | |
1003 | @XmlElement(name = "validationError", required = true) | |
1004 | List<WorkflowAttributeValidationError> validateWorkflowAttributeDefinition( | |
1005 | @WebParam(name = "definition") WorkflowAttributeDefinition definition) | |
1006 | throws RiceIllegalArgumentException; | |
1007 | ||
1008 | // TODO add the following methods to this service | |
1009 | ||
1010 | // boolean isUserInRouteLog( | |
1011 | // @WebParam(name = "documentId") String documentId, | |
1012 | // @WebParam(name = "principalId") String principalId, | |
1013 | // @WebParam(name = "lookFuture") boolean lookFuture) | |
1014 | // throws WorkflowException; | |
1015 | // | |
1016 | // boolean isUserInRouteLogWithOptionalFlattening( | |
1017 | // @WebParam(name = "documentId") String documentId, | |
1018 | // @WebParam(name = "principalId") String principalId, | |
1019 | // @WebParam(name = "lookFuture") boolean lookFuture, | |
1020 | // @WebParam(name = "flattenNodes") boolean flattenNodes) | |
1021 | // throws WorkflowException; | |
1022 | // | |
1023 | // void reResolveRoleByDocTypeName( | |
1024 | // @WebParam(name = "documentTypeName") String documentTypeName, | |
1025 | // @WebParam(name = "roleName") String roleName, | |
1026 | // @WebParam(name = "qualifiedRoleNameLabel") String qualifiedRoleNameLabel) | |
1027 | // throws WorkflowException; | |
1028 | // | |
1029 | // void reResolveRoleByDocumentId( | |
1030 | // @WebParam(name = "documentId") String documentId, | |
1031 | // @WebParam(name = "roleName") String roleName, | |
1032 | // @WebParam(name = "qualifiedRoleNameLabel") String qualifiedRoleNameLabel) | |
1033 | // throws WorkflowException; | |
1034 | // | |
1035 | // DocumentDetailDTO routingReport( | |
1036 | // @WebParam(name = "reportCriteria") ReportCriteriaDTO reportCriteria) | |
1037 | // throws WorkflowException; | |
1038 | // | |
1039 | // boolean isFinalApprover( | |
1040 | // @WebParam(name = "documentId") String documentId, | |
1041 | // @WebParam(name = "principalId") String principalId) | |
1042 | // throws WorkflowException; | |
1043 | // | |
1044 | // boolean isLastApproverAtNode( | |
1045 | // @WebParam(name = "documentId") String documentId, | |
1046 | // @WebParam(name = "principalId") String principalId, | |
1047 | // @WebParam(name = "nodeName") String nodeName) | |
1048 | // throws WorkflowException; | |
1049 | // | |
1050 | // boolean routeNodeHasApproverActionRequest( | |
1051 | // @WebParam(name = "docType") String docType, | |
1052 | // @WebParam(name = "docContent") String docContent, | |
1053 | // @WebParam(name = "nodeName") String nodeName) | |
1054 | // throws WorkflowException; | |
1055 | // | |
1056 | // boolean documentWillHaveAtLeastOneActionRequest( | |
1057 | // @WebParam(name = "reportCriteriaDTO") ReportCriteriaDTO reportCriteriaDTO, | |
1058 | // @WebParam(name = "actionRequestedCodes") String[] actionRequestedCodes, | |
1059 | // @WebParam(name = "ignoreCurrentActionRequests") boolean ignoreCurrentActionRequests); | |
1060 | // | |
1061 | // | |
1062 | // String[] getPrincipalIdsInRouteLog( | |
1063 | // @WebParam(name = "documentId") String documentId, | |
1064 | // @WebParam(name = "lookFuture") boolean lookFuture) | |
1065 | // throws WorkflowException; | |
1066 | ||
1067 | } |