View Javadoc

1   /**
2    * Copyright 2005-2015 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.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.core.api.uif.RemotableAttributeError;
31  import org.kuali.rice.kew.api.KewApiConstants;
32  import org.kuali.rice.kew.api.WorkflowDocument;
33  import org.kuali.rice.kew.api.doctype.IllegalDocumentTypeException;
34  import org.kuali.rice.kew.api.document.Document;
35  import org.kuali.rice.kew.api.document.DocumentContentUpdate;
36  import org.kuali.rice.kew.api.document.DocumentDetail;
37  import org.kuali.rice.kew.api.document.DocumentStatus;
38  import org.kuali.rice.kew.api.document.DocumentUpdate;
39  import org.kuali.rice.kew.api.document.InvalidDocumentContentException;
40  import org.kuali.rice.kew.api.document.attribute.WorkflowAttributeDefinition;
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 = "workflowDocumentActionsService", 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 org.kuali.rice.kew.api.document.node.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_v2_1_3")
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     /**
377      * Executes an {@link ActionType#ADHOC_REQUEST} action for the given principal and document
378      * specified in the supplied parameters to create an ad hoc action request to the target
379      * principal specified in the {@code AdHocToPrincipal}.
380      *
381      * <p>
382      * Operates as per {@link #adHocToGroup(DocumentActionParameters, AdHocToGroup)} with the
383      * exception that this method is used to send an adhoc request to principal instead of a group.
384      *
385      * <p>
386      * Besides this difference, the same rules that are in play for sending ad hoc requests to group
387      * apply for sending ad hoc requests to principals.
388      *
389      * @param parameters the parameters which indicate which principal is executing the action
390      *        against which document, as well as additional operations to take against the document,
391      *        such as updating document data
392      * @param adHocToPrincipal defines various pieces of information that informs what type of ad
393      *        hoc request should be created
394      *
395      * @return the result of executing the action, including a view on the updated state of the
396      *         document and related actions
397      *
398      * @throws RiceIllegalArgumentException if {@code parameters} is null
399      * @throws RiceIllegalArgumentException if {@code adHocToPrincipal} is null
400      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
401      *         {@code parameters} exists
402      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
403      *         in {@code parameters} exists
404      * @throws InvalidDocumentContentException if the document content on the
405      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
406      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
407      *         action
408      * @throws InvalidActionTakenException if the target principal is not permitted to receive ad
409      *         hoc requests on documents of this type
410      * @throws InvalidActionTakenException if the specified ad hoc request cannot be generated
411      *         because the current state of the document would result in an illegal request being
412      *         generated
413      *
414      * @see #adHocToGroup(DocumentActionParameters, AdHocToGroup)
415      * @since 2.1.3
416      */
417     @Deprecated
418     @WebMethod(operationName = "adHocToPrincipal")
419     @WebResult(name = "documentActionResult")
420     @XmlElement(name = "documentActionResult", required = true)
421     DocumentActionResult adHocToPrincipal(
422             @WebParam(name = "parameters") DocumentActionParameters parameters,
423             @WebParam(name = "adHocToPrincipal") AdHocToPrincipal_v2_1_2 adHocToPrincipal)
424             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
425 
426     /**
427      * Executes an {@link ActionType#ADHOC_REQUEST} action for the given group and document
428      * specified in the supplied parameters to create an ad hoc action request to the target group
429      * specified in the {@code AdHocToGroup}. The {@code AdHocToGroup} contains additional
430      * information on how the ad hoc action request should be created, including the type of request
431      * to generate, at which node it should generated, etc.
432      * 
433      * <p>
434      * The policy for how ad hoc actions handle request generation and interact with the workflow
435      * engine is different depending on the state of the document when the request to generate the
436      * ad hoc is submitted. There are also different scenarios under which certain types of ad hoc
437      * actions are allowed to be executed (throwing {@link InvalidActionTakenException} in
438      * situations where the actions are not permitted). The rules are defined as follows:
439      * 
440      * <ol>
441      * <li>If the status of the document is {@link DocumentStatus#INITIATED} then the action request
442      * will be generated with a status of {@link ActionRequestStatus#INITIALIZED} and no processing
443      * directives will be submitted to the workflow engine. When the document is routed, these ad
444      * hoc requests will get activated</li>
445      * <li>If the ad hoc request being created is an {@link ActionRequestType#COMPLETE} or
446      * {@link ActionRequestType#APPROVE} and the document is in a "terminal" state (either
447      * {@link DocumentStatus#CANCELED}, {@link DocumentStatus#DISAPPROVED},
448      * {@link DocumentStatus#PROCESSED}, {@link DocumentStatus#FINAL}) or is in
449      * {@link DocumentStatus#EXCEPTION} status, then an {@link InvalidActionTakenException} will be
450      * thrown. This is because submitting such an action with a document in that state would result
451      * in creation of an illegal action request.</li>
452      * <li>If the document is in a "terminal" state (see above for definition) then the request will
453      * be immediately (and synchronously) activated.</li>
454      * <li>Otherwise, after creating the ad hoc request it will be in the
455      * {@link ActionRequestStatus#INITIALIZED} status, and the document will be immediately
456      * forwarded to the workflow engine for processing at which point the ad hoc request will
457      * activated at the appropriate time.</li>
458      * </ol>
459      * 
460      * <p>
461      * Unlink other actions, ad hoc actions don't result in the recording of an {@link ActionTaken}
462      * against the document. Instead, only the requested ad hoc {@link ActionRequest} is created.
463      * 
464      * @param parameters the parameters which indicate which principal is executing the action
465      *        against which document, as well as additional operations to take against the document,
466      *        such as updating document data
467      * @param adHocToGroup defines various pieces of information that informs what type of ad hoc
468      *        request should be created
469      * 
470      * @return the result of executing the action, including a view on the updated state of the
471      *         document and related actions
472      * 
473      * @throws RiceIllegalArgumentException if {@code parameters} is null
474      * @throws RiceIllegalArgumentException if {@code adHocToGroup} is null
475      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
476      *         {@code parameters} exists
477      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
478      *         in {@code parameters} exists
479      * @throws InvalidDocumentContentException if the document content on the
480      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
481      * @throws InvalidActionTakenException if the supplied principals i is not allowed to execute
482      *         this action
483      * @throws InvalidActionTakenException if any of the principals in the target group are not
484      *         permitted to receive ad hoc requests on documents of this type
485      * @throws InvalidActionTakenException if the specified ad hoc request cannot be generated
486      *         because the current state of the document would result in an illegal request being
487      *         generated
488      */
489     @WebMethod(operationName = "adHocToGroup_v2_1_3")
490     @WebResult(name = "documentActionResult")
491     @XmlElement(name = "documentActionResult", required = true)
492     DocumentActionResult adHocToGroup(
493             @WebParam(name = "parameters") DocumentActionParameters parameters,
494             @WebParam(name = "adHocToGroup") AdHocToGroup adHocToGroup)
495             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
496 
497     /**
498      * Executes an {@link ActionType#ADHOC_REQUEST} action for the given group and document
499      * specified in the supplied parameters to create an ad hoc action request to the target group
500      * specified in the {@code AdHocToGroup}. The {@code AdHocToGroup} contains additional
501      * information on how the ad hoc action request should be created, including the type of request
502      * to generate, at which node it should generated, etc.
503      *
504      * <p>
505      * The policy for how ad hoc actions handle request generation and interact with the workflow
506      * engine is different depending on the state of the document when the request to generate the
507      * ad hoc is submitted. There are also different scenarios under which certain types of ad hoc
508      * actions are allowed to be executed (throwing {@link InvalidActionTakenException} in
509      * situations where the actions are not permitted). The rules are defined as follows:
510      *
511      * <ol>
512      * <li>If the status of the document is {@link DocumentStatus#INITIATED} then the action request
513      * will be generated with a status of {@link ActionRequestStatus#INITIALIZED} and no processing
514      * directives will be submitted to the workflow engine. When the document is routed, these ad
515      * hoc requests will get activated</li>
516      * <li>If the ad hoc request being created is an {@link ActionRequestType#COMPLETE} or
517      * {@link ActionRequestType#APPROVE} and the document is in a "terminal" state (either
518      * {@link DocumentStatus#CANCELED}, {@link DocumentStatus#DISAPPROVED},
519      * {@link DocumentStatus#PROCESSED}, {@link DocumentStatus#FINAL}) or is in
520      * {@link DocumentStatus#EXCEPTION} status, then an {@link InvalidActionTakenException} will be
521      * thrown. This is because submitting such an action with a document in that state would result
522      * in creation of an illegal action request.</li>
523      * <li>If the document is in a "terminal" state (see above for definition) then the request will
524      * be immediately (and synchronously) activated.</li>
525      * <li>Otherwise, after creating the ad hoc request it will be in the
526      * {@link ActionRequestStatus#INITIALIZED} status, and the document will be immediately
527      * forwarded to the workflow engine for processing at which point the ad hoc request will
528      * activated at the appropriate time.</li>
529      * </ol>
530      *
531      * <p>
532      * Unlink other actions, ad hoc actions don't result in the recording of an {@link ActionTaken}
533      * against the document. Instead, only the requested ad hoc {@link ActionRequest} is created.
534      *
535      * @param parameters the parameters which indicate which principal is executing the action
536      *        against which document, as well as additional operations to take against the document,
537      *        such as updating document data
538      * @param adHocToGroup defines various pieces of information that informs what type of ad hoc
539      *        request should be created
540      *
541      * @return the result of executing the action, including a view on the updated state of the
542      *         document and related actions
543      *
544      * @throws RiceIllegalArgumentException if {@code parameters} is null
545      * @throws RiceIllegalArgumentException if {@code adHocToGroup} is null
546      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
547      *         {@code parameters} exists
548      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
549      *         in {@code parameters} exists
550      * @throws InvalidDocumentContentException if the document content on the
551      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
552      * @throws InvalidActionTakenException if the supplied principals i is not allowed to execute
553      *         this action
554      * @throws InvalidActionTakenException if any of the principals in the target group are not
555      *         permitted to receive ad hoc requests on documents of this type
556      * @throws InvalidActionTakenException if the specified ad hoc request cannot be generated
557      *         because the current state of the document would result in an illegal request being
558      *         generated
559      * @since 2.1.3
560      */
561     @Deprecated
562     @WebMethod(operationName = "adHocToGroup")
563     @WebResult(name = "documentActionResult")
564     @XmlElement(name = "documentActionResult", required = true)
565     DocumentActionResult adHocToGroup(@WebParam(name = "parameters") DocumentActionParameters parameters,
566             @WebParam(name = "adHocToGroup") AdHocToGroup_v2_1_2 adHocToGroup)
567             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
568 
569     /**
570      * Executes an {@link ActionType#ADHOC_REQUEST_REVOKE} action for the given principal and
571      * document specified in the supplied parameters against the action request with the given id.
572      * The process of revoking an ad hoc request simply deactivates the request associating the
573      * generated {@link ActionTaken} of the revoke action with the deactivated request (this allows
574      * for it to be determined what caused the ad hoc request to be deactivated). As with other
575      * actions, this action taken is then recorded with the document.
576      * 
577      * @param parameters the parameters which indicate which principal is executing the action
578      *        against which document, as well as additional operations to take against the document,
579      *        such as updating document data
580      * @param actionRequestId the id of the action request to revoke
581      * 
582      * @return the result of executing the action, including a view on the updated state of the
583      *         document and related actions
584      * 
585      * @throws RiceIllegalArgumentException if {@code parameters} is null
586      * @throws RiceIllegalArgumentException if {@code actionRequestId} is null or blank
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      * @throws InvalidActionTakenException if a pending ad hoc request with the given
596      *         {@code actionRequestId} does not exist on the specified document, this could mean
597      *         that the action request id is invalid, or that the action request has already been
598      *         deactivated and is no longer pending
599      */
600     @WebMethod(operationName = "revokeAdHocRequestById")
601     @WebResult(name = "documentActionResult")
602     @XmlElement(name = "documentActionResult", required = true)
603     DocumentActionResult revokeAdHocRequestById(
604             @WebParam(name = "parameters") DocumentActionParameters parameters,
605             @WebParam(name = "actionRequestId") String actionRequestId)
606             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
607 
608     /**
609      * Executes an {@link ActionType#ADHOC_REQUEST_REVOKE} action which revokes all pending ad hoc
610      * action requests that match the supplied {@link AdHocRevoke} criteria for the given principal
611      * and document specified in the supplied parameters. The process of revoking an ad hoc requests
612      * simply deactivates all ad hoc requests that match the given {@code AdHocRevoke} criteria,
613      * associating the generated {@link ActionTaken} of the revoke action with the deactivated
614      * requests (this allows for it to be determined what caused the ad hoc request to be
615      * deactivated). As with other actions, this action taken is then recorded with the document.
616      * 
617      * <p>
618      * It's possible that the given ad hoc revoke command will match no action requests on the
619      * document, in which case this method will complete successfully but no requests will be
620      * deactivated.
621      * 
622      * @param parameters the parameters which indicate which principal is executing the action
623      *        against which document, as well as additional operations to take against the document,
624      *        such as updating document data
625      * @param revoke the criteria for matching ad hoc action requests on the specified document that
626      *        should be revoked
627      * 
628      * @return the result of executing the action, including a view on the updated state of the
629      *         document and related actions
630      * 
631      * @throws RiceIllegalArgumentException if {@code parameters} is null
632      * @throws RiceIllegalArgumentException if {@code revoke} is null
633      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
634      *         {@code parameters} exists
635      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
636      *         in {@code parameters} exists
637      * @throws InvalidDocumentContentException if the document content on the
638      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
639      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
640      *         action
641      */
642     @WebMethod(operationName = "revokeAdHocRequests")
643     @WebResult(name = "documentActionResult")
644     @XmlElement(name = "documentActionResult", required = true)
645     DocumentActionResult revokeAdHocRequests(
646             @WebParam(name = "parameters") DocumentActionParameters parameters,
647             @WebParam(name = "revoke") AdHocRevoke revoke)
648             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
649 
650     /**
651      * Executes an {@link ActionType#ADHOC_REQUEST_REVOKE} action which revokes all pending ad hoc
652      * action requests for the given principal and document specified in the supplied parameters.
653      * This process of revoking all ad hoc requests will simply deactivate all ad hoc requests on
654      * the specified document, associating the generated {@link ActionTaken} of the revoke action
655      * with the deactivated requests (this allows for it to be determined what caused the ad hoc
656      * request to be deactivated). As with other actions, this action taken is then recorded with
657      * the document.
658      * 
659      * <p>
660      * It's possible that the specified document will have no pending adhoc requests, in which case
661      * this method will complete successfully but no requests will be deactivated.
662      * 
663      * @param parameters the parameters which indicate which principal is executing the action
664      *        against which document, as well as additional operations to take against the document,
665      *        such as updating document data
666      * 
667      * @return the result of executing the action, including a view on the updated state of the
668      *         document and related actions
669      * 
670      * @throws RiceIllegalArgumentException if {@code parameters} is null
671      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
672      *         {@code parameters} exists
673      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
674      *         in {@code parameters} exists
675      * @throws InvalidDocumentContentException if the document content on the
676      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
677      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
678      *         action
679      */
680     @WebMethod(operationName = "revokeAllAdHocRequests")
681     @WebResult(name = "documentActionResult")
682     @XmlElement(name = "documentActionResult", required = true)
683     DocumentActionResult revokeAllAdHocRequests(@WebParam(name = "parameters") DocumentActionParameters parameters)
684             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
685 
686     /**
687      * Executes a {@link ActionType#CANCEL} action for the given principal and document specified in
688      * the supplied parameters. When a principal cancels a document, all pending action requests on
689      * the document are deactivated and the the principal's action will be recorded on the document
690      * as an {@link ActionTaken}. Additionally, the document will be (synchronously) transitioned to
691      * the {@link DocumentStatus#CANCELED} status.
692      * 
693      * <p>
694      * In order to cancel a document, the principal must have permission to cancel documents of the
695      * appropriate type, and one of the following must hold true:
696      * 
697      * <ol>
698      * <li>The document must have a status of {@link DocumentStatus#INITIATED} <strong>or</strong></li>
699      * <li>The document must have a status of {@link DocumentStatus#SAVED} <strong>or</strong></li>
700      * <li>The principal must have a pending "complete" or "approve" request on the document.
701      * 
702      * @param parameters the parameters which indicate which principal is executing the action
703      *        against which document, as well as additional operations to take against the document,
704      *        such as updating document data
705      * 
706      * @return the result of executing the action, including a view on the updated state of the
707      *         document and related actions
708      * 
709      * @throws RiceIllegalArgumentException if {@code parameters} is null
710      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
711      *         {@code parameters} exists
712      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
713      *         in {@code parameters} exists
714      * @throws InvalidDocumentContentException if the document content on the
715      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
716      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
717      *         action
718      */
719     @WebMethod(operationName = "cancel")
720     @WebResult(name = "documentActionResult")
721     @XmlElement(name = "documentActionResult", required = true)
722     DocumentActionResult cancel(@WebParam(name = "parameters") DocumentActionParameters parameters)
723             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
724 
725     /**
726      * Executes a {@link ActionType#RECALL} action for the given principal and document specified in
727      * the supplied parameters. When a principal cancels a document, all pending action requests on
728      * the document are deactivated and the the principal's action will be recorded on the document
729      * as an {@link ActionTaken}. Additionally, the document will be (synchronously) transitioned to
730      * the {@link DocumentStatus#RECALLED} status.
731      *
732      * TODO: FILL IN DOCS FOR RECALL ACTION
733      * <p>
734      * In order to cancel a document, the principal must have permission to cancel documents of the
735      * appropriate type, and one of the following must hold true:
736      *
737      * <ol>
738      * <li>The document must have a status of {@link DocumentStatus#INITIATED} <strong>or</strong></li>
739      * <li>The document must have a status of {@link DocumentStatus#SAVED} <strong>or</strong></li>
740      * <li>The principal must have a pending "complete" or "approve" request on the document.
741      *
742      * @since 2.1
743      * @param parameters the parameters which indicate which principal is executing the action
744      *        against which document, as well as additional operations to take against the document,
745      *        such as updating document data
746      * @param cancel whether to recall & cancel or recall & return to action list
747      *
748      * @return the result of executing the action, including a view on the updated state of the
749      *         document and related actions
750      *
751      * @throws RiceIllegalArgumentException if {@code parameters} is null
752      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
753      *         {@code parameters} exists
754      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
755      *         in {@code parameters} exists
756      * @throws InvalidDocumentContentException if the document content on the
757      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
758      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
759      *         action
760      */
761     @WebMethod(operationName = "recall")
762     @WebResult(name = "documentActionResult")
763     @XmlElement(name = "documentActionResult", required = true)
764     DocumentActionResult recall(@WebParam(name = "parameters") DocumentActionParameters parameters,
765                                 @WebParam(name = "cancel") boolean cancel)
766             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
767 
768     /**
769      * Executes an {@link ActionType#FYI} action for the given principal and document specified in
770      * the supplied parameters. When a principal clears fyis on a document, any of the principal's
771      * pending fyis will be satisfied by the principal's action. The principal's action should be
772      * recorded with the document as an {@link ActionTaken}.
773      * 
774      * <p>
775      * Depending on document type policy, a pending fyi request may have to exist on the document in
776      * order for the principal to take this action. Otherwise an {@link InvalidActionTakenException}
777      * may be thrown. In order to determine if an fyi action is valid, the {@link ValidActions} or
778      * {@link RequestedActions} for the document can be checked.
779      * 
780      * @param parameters the parameters which indicate which principal is executing the action
781      *        against which document, as well as additional operations to take against the document,
782      *        such as updating document data
783      * 
784      * @return the result of executing the action, including a view on the updated state of the
785      *         document and related actions
786      * 
787      * @throws RiceIllegalArgumentException if {@code parameters} is null
788      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
789      *         {@code parameters} exists
790      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
791      *         in {@code parameters} exists
792      * @throws InvalidDocumentContentException if the document content on the
793      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
794      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
795      *         action
796      */
797     @WebMethod(operationName = "clearFyi")
798     @WebResult(name = "documentActionResult")
799     @XmlElement(name = "documentActionResult", required = true)
800     DocumentActionResult clearFyi(@WebParam(name = "parameters") DocumentActionParameters parameters)
801             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
802 
803     /**
804      * Executes an {@link ActionType#COMPLETE} action for the given principal and document specified
805      * in the supplied parameters. When a principal completes a document, any of the principal's
806      * pending action requests at or below the complete level (which includes approve, acknowledge,
807      * and fyi requests as well) will be satisfied by the principal's action. The principal's action
808      * should be recorded with the document as an {@link ActionTaken}.
809      * 
810      * <p>
811      * Depending on document type policy, a pending action request at or below the complete level
812      * may have to exist on the document in order for the principal to take this action. Otherwise
813      * an {@link InvalidActionTakenException} may be thrown. In order to determine if an complete
814      * action is valid, the {@link ValidActions} or {@link RequestedActions} for the document can be
815      * checked.
816      * 
817      * @param parameters the parameters which indicate which principal is executing the action
818      *        against which document, as well as additional operations to take against the document,
819      *        such as updating document data
820      * 
821      * @return the result of executing the action, including a view on the updated state of the
822      *         document and related actions
823      * 
824      * @throws RiceIllegalArgumentException if {@code parameters} is null
825      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
826      *         {@code parameters} exists
827      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
828      *         in {@code parameters} exists
829      * @throws InvalidDocumentContentException if the document content on the
830      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
831      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
832      *         action
833      */
834     @WebMethod(operationName = "complete")
835     @WebResult(name = "documentActionResult")
836     @XmlElement(name = "documentActionResult", required = true)
837     DocumentActionResult complete(@WebParam(name = "parameters") DocumentActionParameters parameters)
838             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
839 
840     /**
841      * Executes a {@link ActionType#DISAPPROVE} action for the given principal and document
842      * specified in the supplied parameters. When a principal disapproves a document, all pending
843      * action requests on the document are deactivated and the the principal's action will be
844      * recorded on the document as an {@link ActionTaken}. Additionally, the document will be
845      * (synchronously) transitioned to the {@link DocumentStatus#DISAPPROVED} status.
846      * 
847      * <p>
848      * Depending on document type policy and configuration, notifications may be sent to past
849      * approvers of the document. By default, an "acknowledge" request will be sent to each
850      * principal who took an "approve" or "complete" action on the document previously.
851      * 
852      * <p>
853      * In order to disapprove a document, the principal must have a pending approve or complete
854      * request on the document.
855      * 
856      * @param parameters the parameters which indicate which principal is executing the action
857      *        against which document, as well as additional operations to take against the document,
858      *        such as updating document data
859      * 
860      * @return the result of executing the action, including a view on the updated state of the
861      *         document and related actions
862      * 
863      * @throws RiceIllegalArgumentException if {@code parameters} is null
864      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
865      *         {@code parameters} exists
866      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
867      *         in {@code parameters} exists
868      * @throws InvalidDocumentContentException if the document content on the
869      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
870      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
871      *         action
872      */
873     @WebMethod(operationName = "disapprove")
874     @WebResult(name = "documentActionResult")
875     @XmlElement(name = "documentActionResult", required = true)
876     DocumentActionResult disapprove(@WebParam(name = "parameters") DocumentActionParameters parameters)
877             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
878 
879     /**
880      * Submits a document that is in either the "initiated" or "saved" state to the workflow engine
881      * for processing. The route action triggers the beginning of the routing process and
882      * (synchronously) switches the status of the document to {@link DocumentStatus#ENROUTE}. It
883      * then queues up a request to the workflow engine to process the document.
884      * 
885      * <p>
886      * When the route action is executed, an {@link ActionType#COMPLETE} action is recorded on the
887      * document for the principal who executed the route action. At this point in time, any action
888      * requests that are currently on the document in an "initialized" state will be activated.
889      * Requests of this nature can commonly exist if ad hoc requests have been attached to the
890      * document prior to execution of the route action.
891      * 
892      * <p>
893      * By default, the principal who initiated the document is the same principal who must submit
894      * the route command. However, a document type policy can be set which will relax this
895      * constraint.
896      * 
897      * <p>
898      * The route action should ideally only ever be executed once for a given document. Depending on
899      * document type policy, attempting to execute a "route" action against a document which is
900      * already enroute or in a terminal state may result in an {@link InvalidActionTakenException}
901      * being thrown.
902      * 
903      * @param parameters the parameters which indicate which principal is executing the action
904      *        against which document, as well as additional operations to take against the document,
905      *        such as updating document data
906      * 
907      * @return the result of executing the action, including a view on the updated state of the
908      *         document and related actions
909      * 
910      * @throws RiceIllegalArgumentException if {@code parameters} is null
911      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
912      *         {@code parameters} exists
913      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
914      *         in {@code parameters} exists
915      * @throws InvalidDocumentContentException if the document content on the
916      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
917      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
918      *         action
919      */
920     @WebMethod(operationName = "route")
921     @WebResult(name = "documentActionResult")
922     @XmlElement(name = "documentActionResult", required = true)
923     DocumentActionResult route(@WebParam(name = "parameters") DocumentActionParameters parameters)
924             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
925 
926     /**
927      * Triggers the execution of a full {@link ActionType#BLANKET_APPROVE} action for the given
928      * principal and document specified in the supplied parameters. Blanket approval will
929      * orchestrate a document from it's current node all the way to the end of the document's
930      * workflow process. During this process, it will automatically act on all "approve" and
931      * "complete" requests, effectively bypassing them. When it does this, it will notify the
932      * original recipients of these requests by routing acknowledge requests to them.
933      * 
934      * <p>
935      * Blanket approve processing is handled by a special mode of the workflow engine which runs the
936      * document through it's full processing lifecycle, ensuring that it makes it's way to the end
937      * of it's route path (by bypassing any steps that would cause the process to halt, such as
938      * approval requests). Because of this nature, blanket approve processing behavior is governed
939      * by the same configuration as the rest of the workflow engine. So depending on whether the
940      * engine is configured or synchronous or asynchronous operation, the blanket approve processing
941      * will behave in the same manner.
942      * 
943      * <p>
944      * In order to execute a blanket approve operation, the principal must have permissions to do
945      * so.
946      * 
947      * @param parameters the parameters which indicate which principal is executing the action
948      *        against which document, as well as additional operations to take against the document,
949      *        such as updating document data
950      * 
951      * @return the result of executing the action, including a view on the updated state of the
952      *         document and related actions
953      * 
954      * @throws RiceIllegalArgumentException if {@code parameters} is null
955      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
956      *         {@code parameters} exists
957      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
958      *         in {@code parameters} exists
959      * @throws InvalidDocumentContentException if the document content on the
960      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
961      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
962      *         action
963      */
964     @WebMethod(operationName = "blanketApprove")
965     @WebResult(name = "documentActionResult")
966     @XmlElement(name = "documentActionResult", required = true)
967     DocumentActionResult blanketApprove(@WebParam(name = "parameters") DocumentActionParameters parameters)
968             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
969 
970     /**
971      * Triggers the execution of a {@link ActionType#BLANKET_APPROVE} action which orchestrates the
972      * document to the given set of node names for the given principal and document specified in the
973      * supplied parameters. This method functions the same as
974      * {@link #blanketApprove(DocumentActionParameters)} with the exception that the blanket approve
975      * process will be halted once all node names in the given set have been reached.
976      * 
977      * <p>
978      * If null or an empty set is passed for {@code nodeNames} on this method, it's behavior will be
979      * equivalent to {@link #blanketApprove(DocumentActionParameters)}.
980      * 
981      * @param parameters the parameters which indicate which principal is executing the action
982      *        against which document, as well as additional operations to take against the document,
983      *        such as updating document data
984      * @param nodeNames a set of node names to which to blanket approve the given document
985      * 
986      * @return the result of executing the action, including a view on the updated state of the
987      *         document and related actions
988      * 
989      * @throws RiceIllegalArgumentException if {@code parameters} is null
990      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
991      *         {@code parameters} exists
992      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
993      *         in {@code parameters} exists
994      * @throws InvalidDocumentContentException if the document content on the
995      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
996      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
997      *         action
998      */
999     @WebMethod(operationName = "blanketApproveToNodes")
1000     @WebResult(name = "documentActionResult")
1001     @XmlElement(name = "documentActionResult", required = true)
1002     DocumentActionResult blanketApproveToNodes(
1003             @WebParam(name = "parameters") DocumentActionParameters parameters,
1004             @WebParam(name = "nodeName") Set<String> nodeNames)
1005             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1006 
1007     /**
1008      * Triggers the execution of a {@link ActionType#RETURN_TO_PREVIOUS} action for the given
1009      * principal and document specified in the supplied parameters. Return a document to a previous
1010      * node will allow for the document to be pushed back to an earlier node in the process based on
1011      * the criteria present in the {@link ReturnPoint} that is passed to this method.
1012      * 
1013      * <p>
1014      * The document is synchronously returned to the suggested return point (assuming the desired
1015      * return point can be identified for the given document), and then the document will be
1016      * submitted to the engine for further processing (effectively, re-establishing the flow of the
1017      * document from the target return point).
1018      * 
1019      * <p>
1020      * Return the document to the first node in the document is treated as a special case and,
1021      * rather then transitioning the document back to the "initiated" status, will route a
1022      * "complete" request to the initiator of the document. The effectively enacts a return to the
1023      * document initiator in these cases.
1024      * 
1025      * @param parameters the parameters which indicate which principal is executing the action
1026      *        against which document, as well as additional operations to take against the document,
1027      *        such as updating document data
1028      * 
1029      * @return the result of executing the action, including a view on the updated state of the
1030      *         document and related actions
1031      * 
1032      * @throws RiceIllegalArgumentException if {@code parameters} is null
1033      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1034      *         {@code parameters} exists
1035      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1036      *         in {@code parameters} exists
1037      * @throws InvalidDocumentContentException if the document content on the
1038      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1039      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1040      *         action
1041      */
1042     @WebMethod(operationName = "returnToPreviousNode")
1043     @WebResult(name = "documentActionResult")
1044     @XmlElement(name = "documentActionResult", required = true)
1045     DocumentActionResult returnToPreviousNode(
1046             @WebParam(name = "parameters") DocumentActionParameters parameters,
1047             @WebParam(name = "returnPoint") ReturnPoint returnPoint)
1048             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1049 
1050 
1051     /**
1052      * Triggers the execution of a {@link ActionType#MOVE} action for the given
1053      * principal and document specified in the supplied parameters. Move a document to a
1054      * node will allow for the document to be pushed to a different node in the process based on
1055      * the criteria present in the {@link MovePoint} that is passed to this method.
1056      *
1057      * <p />
1058      * The document is synchronously moved to the suggested move point (assuming the desired
1059      * move point can be identified for the given document), and then the document will be
1060      * submitted to the engine for further processing (effectively, re-establishing the flow of the
1061      * document from the target return point).
1062      *
1063      *
1064      * @param parameters the parameters which indicate which principal is executing the action
1065      *        against which document, as well as additional operations to take against the document,
1066      *        such as updating document data
1067      * @param movePoint the point to move the document
1068      *
1069      * @return the result of executing the action, including a view on the updated state of the
1070      *         document and related actions
1071      *
1072      * @throws RiceIllegalArgumentException if {@code parameters} is null
1073      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1074      *         {@code parameters} exists
1075      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1076      *         in {@code parameters} exists
1077      * @throws InvalidDocumentContentException if the document content on the
1078      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1079      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1080      *         action
1081      */
1082     @WebMethod(operationName = "move")
1083     @WebResult(name = "documentActionResult")
1084     @XmlElement(name = "documentActionResult", required = true)
1085     DocumentActionResult move(
1086             @WebParam(name = "parameters") DocumentActionParameters parameters,
1087             @WebParam(name = "movePoint") MovePoint movePoint)
1088             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1089 
1090     /**
1091      * Triggers the execution of a {@link ActionType#TAKE_GROUP_AUTHORITY} action for the given
1092      * principal and document specified in the supplied parameters. Takes authority of a group by a
1093      * member of that group.
1094      *
1095      * @param parameters the parameters which indicate which principal is executing the action
1096      *        against which document, as well as additional operations to take against the document,
1097      *        such as updating document data
1098      * @param groupId the group id to take authority of
1099      *
1100      * @return the result of executing the action, including a view on the updated state of the
1101      *         document and related actions
1102      *
1103      * @throws RiceIllegalArgumentException if {@code parameters} is null
1104      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1105      *         {@code parameters} exists
1106      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1107      *         in {@code parameters} exists
1108      * @throws InvalidDocumentContentException if the document content on the
1109      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1110      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1111      *         action
1112      */
1113     @WebMethod(operationName = "takeGroupAuthority")
1114     @WebResult(name = "documentActionResult")
1115     @XmlElement(name = "documentActionResult", required = true)
1116     DocumentActionResult takeGroupAuthority(
1117             @WebParam(name = "parameters") DocumentActionParameters parameters,
1118             @WebParam(name = "groupId") String groupId)
1119             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1120 
1121     /**
1122      * Triggers the execution of a {@link ActionType#RELEASE_GROUP_AUTHORITY} action for the given
1123      * principal and document specified in the supplied parameters. Releases authority of a group by a
1124      * member of that group.
1125      *
1126      * @param parameters the parameters which indicate which principal is executing the action
1127      *        against which document, as well as additional operations to take against the document,
1128      *        such as updating document data
1129      * @param groupId the group id to take authority of
1130      *
1131      * @return the result of executing the action, including a view on the updated state of the
1132      *         document and related actions
1133      *
1134      * @throws RiceIllegalArgumentException if {@code parameters} is null
1135      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1136      *         {@code parameters} exists
1137      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1138      *         in {@code parameters} exists
1139      * @throws InvalidDocumentContentException if the document content on the
1140      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1141      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1142      *         action
1143      */
1144     @WebMethod(operationName = "releaseGroupAuthority")
1145     @WebResult(name = "documentActionResult")
1146     @XmlElement(name = "documentActionResult", required = true)
1147     DocumentActionResult releaseGroupAuthority(
1148             @WebParam(name = "parameters") DocumentActionParameters parameters,
1149             @WebParam(name = "groupId") String groupId)
1150             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1151 
1152     /**
1153      * Triggers the execution of a {@link ActionType#SAVE} action for the given
1154      * principal and document specified in the supplied parameters. Saves a document to a
1155      * at the current point.
1156      *
1157      * @param parameters the parameters which indicate which principal is executing the action
1158      *        against which document, as well as additional operations to take against the document,
1159      *        such as updating document data
1160      *
1161      * @return the result of executing the action, including a view on the updated state of the
1162      *         document and related actions
1163      *
1164      * @throws RiceIllegalArgumentException if {@code parameters} is null
1165      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1166      *         {@code parameters} exists
1167      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1168      *         in {@code parameters} exists
1169      * @throws InvalidDocumentContentException if the document content on the
1170      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1171      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1172      *         action
1173      */
1174     @WebMethod(operationName = "save")
1175     @WebResult(name = "documentActionResult")
1176     @XmlElement(name = "documentActionResult", required = true)
1177     DocumentActionResult save(@WebParam(name = "parameters") DocumentActionParameters parameters)
1178             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1179 
1180     /**
1181      * Triggers the execution of a {@link ActionType#SAVE} action for the given
1182      * principal and document specified in the supplied parameters. Saves the current document data for
1183      * the document.  Note that passing an annotation to this will have no effect because it is not
1184      * recorded in the route log
1185      *
1186      * @param parameters the parameters which indicate which principal is executing the action
1187      *        against which document, as well as additional operations to take against the document,
1188      *        such as updating document data
1189      *
1190      * @return the result of executing the action, including a view on the updated state of the
1191      *         document and related actions
1192      *
1193      * @throws RiceIllegalArgumentException if {@code parameters} is null
1194      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1195      *         {@code parameters} exists
1196      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1197      *         in {@code parameters} exists
1198      * @throws InvalidDocumentContentException if the document content on the
1199      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1200      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1201      *         action
1202      */
1203     @WebMethod(operationName = "saveDocumentData")
1204     @WebResult(name = "documentActionResult")
1205     @XmlElement(name = "documentActionResult", required = true)
1206     DocumentActionResult saveDocumentData(@WebParam(name = "parameters") DocumentActionParameters parameters)
1207             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1208 
1209     /**
1210      * Deletes the document.
1211      *
1212      * @param documentId the unique id of the document to delete
1213      * @param principalId
1214      *
1215      * @return the document that was removed from the system
1216      *
1217      * @throws RiceIllegalArgumentException if {@code documentId} is null
1218      * @throws RiceIllegalArgumentException if {@code principalId} is null
1219      * @throws RiceIllegalArgumentException if no document with the {@code documentId} exists
1220      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1221      *         action
1222      */
1223     @WebMethod(operationName = "delete")
1224     @WebResult(name = "document")
1225     @XmlElement(name = "document", required = true)
1226     Document delete(
1227             @WebParam(name = "documentId") String documentId,
1228             @WebParam(name = "principalId") String principalId)
1229             throws RiceIllegalArgumentException, InvalidActionTakenException;
1230 
1231     /**
1232      * Records the non-routed document action. - Checks to make sure the document status
1233      * allows the action. Records the action.
1234      *
1235      * @param documentId the unique id of the document to delete
1236      * @param principalId
1237      *
1238      * @return the document that was removed from the system
1239      *
1240      * @throws RiceIllegalArgumentException if {@code documentId} is null
1241      * @throws RiceIllegalArgumentException if {@code principalId} is null
1242      * @throws RiceIllegalArgumentException if {@code annotation} is null
1243      * @throws RiceIllegalArgumentException if no document with the {@code documentId} exists
1244      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1245      *         action
1246      */
1247     @WebMethod(operationName = "logAnnotation")
1248     void logAnnotation(
1249             @WebParam(name = "documentId") String documentId,
1250             @WebParam(name = "principalId") String principalId,
1251             @WebParam(name = "annotation") String annotation)
1252             throws RiceIllegalArgumentException, InvalidActionTakenException;
1253 
1254     // TODO  finish javadoc
1255     /**
1256      *
1257      *
1258      * @param documentId the unique id of the document to delete
1259      *
1260      * @throws RiceIllegalArgumentException if {@code documentId} is null
1261      */
1262     @WebMethod(operationName = "initiateIndexing")
1263     void initiateIndexing(@WebParam(name = "documentId") String documentId)
1264             throws RiceIllegalArgumentException;
1265 
1266 
1267     /**
1268      * Triggers the execution of a {@link ActionType#SU_BLANKET_APPROVE} action for the given
1269      * principal and document specified in the supplied parameters. Does a blanket approve for a super user
1270      * and runs post-processing depending on {@code executePostProcessor}
1271      *
1272      * @param parameters the parameters which indicate which principal is executing the action
1273      *        against which document, as well as additional operations to take against the document,
1274      *        such as updating document data
1275      * @param executePostProcessor boolean value determining if the post-processor should be run or not
1276      *
1277      * @return the result of executing the action, including a view on the updated state of the
1278      *         document and related actions
1279      *
1280      * @throws RiceIllegalArgumentException if {@code parameters} is null
1281      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1282      *         {@code parameters} exists
1283      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1284      *         in {@code parameters} exists
1285      * @throws InvalidDocumentContentException if the document content on the
1286      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1287      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1288      *         action
1289      */
1290     @WebMethod(operationName = "superUserBlanketApprove")
1291     @WebResult(name = "documentActionResult")
1292     @XmlElement(name = "documentActionResult", required = true)
1293     DocumentActionResult superUserBlanketApprove(
1294             @WebParam(name = "parameters") DocumentActionParameters parameters,
1295             @WebParam(name = "executePostProcessor") boolean executePostProcessor)
1296             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1297 
1298     /**
1299      * Triggers the execution of a {@link ActionType#SU_APPROVE} action for the given
1300      * principal and document specified in the supplied parameters. Does an approve for a super user
1301      * on a node and runs post-processing depending on {@code executePostProcessor}
1302      *
1303      * @param parameters the parameters which indicate which principal is executing the action
1304      *        against which document, as well as additional operations to take against the document,
1305      *        such as updating document data
1306      * @param executePostProcessor boolean value determining if the post-processor should be run or not
1307      *
1308      * @return the result of executing the action, including a view on the updated state of the
1309      *         document and related actions
1310      *
1311      * @throws RiceIllegalArgumentException if {@code parameters} is null
1312      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1313      *         {@code parameters} exists
1314      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1315      *         in {@code parameters} exists
1316      * @throws InvalidDocumentContentException if the document content on the
1317      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1318      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1319      *         action
1320      */
1321     @WebMethod(operationName = "superUserNodeApprove")
1322     @WebResult(name = "documentActionResult")
1323     @XmlElement(name = "documentActionResult", required = true)
1324     DocumentActionResult superUserNodeApprove(
1325             @WebParam(name = "parameters") DocumentActionParameters parameters,
1326             @WebParam(name = "executePostProcessor") boolean executePostProcessor,
1327             @WebParam(name = "nodeName") String nodeName)
1328             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1329 
1330     /**
1331      * Triggers the execution of a {@link ActionType#SU_APPROVE} action for the given
1332      * actionRequestId and principal and document specified in the supplied parameters. Does an approve for a super user
1333      * on a node and runs post-processing depending on {@code executePostProcessor}
1334      *
1335      * @param parameters the parameters which indicate which principal is executing the action
1336      *        against which document, as well as additional operations to take against the document,
1337      *        such as updating document data
1338      * @param actionRequestId unique Id of an action request to take action on
1339      * @param executePostProcessor boolean value determining if the post-processor should be run or not
1340      *
1341      * @return the result of executing the action, including a view on the updated state of the
1342      *         document and related actions
1343      *
1344      * @throws RiceIllegalArgumentException if {@code parameters} is null
1345      * @throws RiceIllegalArgumentException if (@code actionRequestId}
1346      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1347      *         {@code parameters} exists
1348      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1349      *         in {@code parameters} exists
1350      * @throws InvalidDocumentContentException if the document content on the
1351      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1352      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1353      *         action
1354      */
1355     @WebMethod(operationName = "superUserTakeRequestedAction")
1356     @WebResult(name = "documentActionResult")
1357     @XmlElement(name = "documentActionResult", required = true)
1358     DocumentActionResult superUserTakeRequestedAction(
1359             @WebParam(name = "parameters") DocumentActionParameters parameters,
1360             @WebParam(name = "executePostProcessor") boolean executePostProcessor,
1361             @WebParam(name = "actionRequestId") String actionRequestId)
1362             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1363 
1364     /**
1365      * Triggers the execution of a {@link ActionType#SU_DISAPPROVE} action for the given
1366      * principal and document specified in the supplied parameters. Does a disapprove for a super user
1367      * on a node and runs post-processing depending on {@code executePostProcessor}
1368      *
1369      * @param parameters the parameters which indicate which principal is executing the action
1370      *        against which document, as well as additional operations to take against the document,
1371      *        such as updating document data
1372      * @param executePostProcessor boolean value determining if the post-processor should be run or not
1373      *
1374      * @return the result of executing the action, including a view on the updated state of the
1375      *         document and related actions
1376      *
1377      * @throws RiceIllegalArgumentException if {@code parameters} is null
1378      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1379      *         {@code parameters} exists
1380      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1381      *         in {@code parameters} exists
1382      * @throws InvalidDocumentContentException if the document content on the
1383      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1384      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1385      *         action
1386      */
1387     @WebMethod(operationName = "superUserDisapprove")
1388     @WebResult(name = "documentActionResult")
1389     @XmlElement(name = "documentActionResult", required = true)
1390     DocumentActionResult superUserDisapprove(
1391             @WebParam(name = "parameters") DocumentActionParameters parameters,
1392             @WebParam(name = "executePostProcessor") boolean executePostProcessor)
1393             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1394 
1395     /**
1396      * Triggers the execution of a {@link ActionType#SU_CANCEL} action for the given
1397      * principal and document specified in the supplied parameters. Does an cancel for a super user
1398      * on a node and runs post-processing depending on {@code executePostProcessor}
1399      *
1400      * @param parameters the parameters which indicate which principal is executing the action
1401      *        against which document, as well as additional operations to take against the document,
1402      *        such as updating document data
1403      * @param executePostProcessor boolean value determining if the post-processor should be run or not
1404      *
1405      * @return the result of executing the action, including a view on the updated state of the
1406      *         document and related actions
1407      *
1408      * @throws RiceIllegalArgumentException if {@code parameters} is null
1409      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1410      *         {@code parameters} exists
1411      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1412      *         in {@code parameters} exists
1413      * @throws InvalidDocumentContentException if the document content on the
1414      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1415      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1416      *         action
1417      */
1418     @WebMethod(operationName = "superUserCancel")
1419     @WebResult(name = "documentActionResult")
1420     @XmlElement(name = "documentActionResult", required = true)
1421     DocumentActionResult superUserCancel(
1422             @WebParam(name = "parameters") DocumentActionParameters parameters,
1423             @WebParam(name = "executePostProcessor") boolean executePostProcessor)
1424             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1425 
1426     /**
1427      * Triggers the execution of a {@link ActionType#SU_RETURN_TO_PREVIOUS} action for the given
1428      * principal and document specified in the supplied parameters. Returns the document to the
1429      * previous node for a super user on a node and runs post-processing depending on {@code executePostProcessor}
1430      *
1431      * @param parameters the parameters which indicate which principal is executing the action
1432      *        against which document, as well as additional operations to take against the document,
1433      *        such as updating document data
1434      * @param executePostProcessor boolean value determining if the post-processor should be run or not
1435      * @param returnPoint point to return to
1436      *
1437      * @return the result of executing the action, including a view on the updated state of the
1438      *         document and related actions
1439      *
1440      * @throws RiceIllegalArgumentException if {@code parameters} is null
1441      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1442      *         {@code parameters} exists
1443      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1444      *         in {@code parameters} exists
1445      * @throws InvalidDocumentContentException if the document content on the
1446      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1447      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1448      *         action
1449      */
1450     @WebMethod(operationName = "superUserReturnToPreviousNode")
1451     @WebResult(name = "documentActionResult")
1452     @XmlElement(name = "documentActionResult", required = true)
1453     DocumentActionResult superUserReturnToPreviousNode(
1454             @WebParam(name = "parameters") DocumentActionParameters parameters,
1455             @WebParam(name = "executePostProcessor") boolean executePostProcessor,
1456             @WebParam(name = "returnPoint") ReturnPoint returnPoint)
1457             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1458 
1459     /**
1460      * Places a document in exception routing or the given principal and document specified in the supplied parameters.
1461      *
1462      * @param parameters the parameters which indicate which principal is executing the action
1463      *        against which document, as well as additional operations to take against the document,
1464      *        such as updating document data
1465      *
1466      * @return the result of executing the action, including a view on the updated state of the
1467      *         document and related actions
1468      *
1469      * @throws RiceIllegalArgumentException if {@code parameters} is null
1470      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1471      *         {@code parameters} exists
1472      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1473      *         in {@code parameters} exists
1474      * @throws InvalidDocumentContentException if the document content on the
1475      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1476      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1477      *         action
1478      */
1479     @WebMethod(operationName = "placeInExceptionRouting")
1480     @WebResult(name = "documentActionResult")
1481     @XmlElement(name = "documentActionResult", required = true)
1482     DocumentActionResult placeInExceptionRouting(@WebParam(name = "parameters") DocumentActionParameters parameters)
1483             throws RiceIllegalArgumentException, InvalidDocumentContentException, InvalidActionTakenException;
1484 
1485     /**
1486      * Validates a workflow attribute definition and returns a list of validation errors
1487      *
1488      * @param definition WorkflowAttributeDefinition to validate
1489      *
1490      * @return a list of RemotableAttributeErrors caused by validation of the passed in {@code definition}
1491      *
1492      * @throws RiceIllegalArgumentException if {@code parameters} is null
1493      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1494      *         {@code parameters} exists
1495      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1496      *         in {@code parameters} exists
1497      * @throws InvalidDocumentContentException if the document content on the
1498      *         {@link DocumentContentUpdate} supplied with the {@code parameters} is invalid.
1499      * @throws InvalidActionTakenException if the supplied principal is not allowed to execute this
1500      *         action
1501      */
1502     @WebMethod(operationName = "validateWorkflowAttributeDefinition")
1503     @WebResult(name = "validationErrors")
1504     @XmlElementWrapper(name = "validationErrors", required = true)
1505     @XmlElement(name = "validationError", required = true)
1506     List<RemotableAttributeError> validateWorkflowAttributeDefinition(
1507             @WebParam(name = "definition") WorkflowAttributeDefinition definition)
1508             throws RiceIllegalArgumentException;
1509 
1510     // TODO add, annotate, and javadoc the following methods to this service
1511     /**
1512      * Determines if a passed in user exists in a document's route log or future route depending on the passed in
1513      * {@code lookFuture} value
1514      *
1515      * @param documentId unique Id of document
1516      * @param principalId unique Id of Principal to look for in document's route log
1517      * @param lookFuture boolean value determines whether or not to look at the future route log
1518      *
1519      * @return boolean value representing if a principal exists in a Document's route log
1520      *
1521      * @throws RiceIllegalArgumentException if {@code documentId} is null
1522      * @throws RiceIllegalArgumentException if {@code principalId} is null
1523      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1524      *         {@code parameters} exists
1525      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1526      *         in {@code parameters} exists
1527      */
1528     @WebMethod(operationName = "isUserInRouteLog")
1529     @WebResult(name = "userInRouteLog")
1530     boolean isUserInRouteLog(
1531             @WebParam(name = "documentId") String documentId,
1532             @WebParam(name = "principalId") String principalId,
1533             @WebParam(name = "lookFuture") boolean lookFuture)
1534             throws RiceIllegalArgumentException;
1535 
1536     /**
1537      * Determines if a passed in user exists in a document's route log or future route depending on the passed in
1538      * {@code lookFuture} value and {@code flattenNodes}
1539      *
1540      * @param documentId unique Id of document
1541      * @param principalId unique Id of Principal to look for in document's route log
1542      * @param lookFuture boolean value determines whether or not to look at the future route log
1543      *
1544      * @return boolean value representing if a principal exists in a Document's route log
1545      *
1546      * @throws RiceIllegalArgumentException if {@code documentId} is null
1547      * @throws RiceIllegalArgumentException if {@code principalId} is null
1548      * @throws RiceIllegalArgumentException if no document with the {@code documentId} specified in
1549      *         {@code parameters} exists
1550      * @throws RiceIllegalArgumentException if no principal with the {@code principalId} specified
1551      *         in {@code parameters} exists
1552      */
1553     @WebMethod(operationName = "isUserInRouteLogWithOptionalFlattening")
1554     @WebResult(name = "userInRouteLogWithOptionalFlattening")
1555     boolean isUserInRouteLogWithOptionalFlattening(
1556             @WebParam(name = "documentId") String documentId,
1557             @WebParam(name = "principalId") String principalId,
1558             @WebParam(name = "lookFuture") boolean lookFuture,
1559             @WebParam(name = "flattenNodes") boolean flattenNodes)
1560             throws RiceIllegalArgumentException;
1561 
1562     /**
1563      * Re-resolves the given role for all documents for the given document type (including children).
1564      *
1565      * @param documentTypeName documentTypeName of DocuemntType for role
1566      * @param roleName name of Role to reresolve
1567      * @param qualifiedRoleNameLabel qualified role name label
1568      *
1569      * @throws RiceIllegalArgumentException if {@code documentTypeName} is null
1570      * @throws RiceIllegalArgumentException if {@code roleName} is null
1571      * @throws RiceIllegalArgumentException if {@code qualifiedRoleNameLable} is null
1572      */
1573     @WebMethod(operationName = "reResolveRoleByDocTypeName")
1574     void reResolveRoleByDocTypeName(
1575             @WebParam(name = "documentTypeName") String documentTypeName,
1576             @WebParam(name = "roleName") String roleName,
1577             @WebParam(name = "qualifiedRoleNameLabel") String qualifiedRoleNameLabel)
1578             throws RiceIllegalArgumentException;
1579 
1580     /**
1581      * Re-resolves the given role for all documents for the given document id (including children).
1582      *
1583      * @param documentId documentId of Docuemnt for role
1584      * @param roleName name of Role to reresolve
1585      * @param qualifiedRoleNameLabel qualified role name label
1586      *
1587      * @throws RiceIllegalArgumentException if {@code documentTypeName} is null
1588      * @throws RiceIllegalArgumentException if {@code roleName} is null
1589      * @throws RiceIllegalArgumentException if {@code qualifiedRoleNameLable} is null
1590      */
1591     @WebMethod(operationName = "reResolveRoleByDocumentId")
1592     void reResolveRoleByDocumentId(
1593             @WebParam(name = "documentId") String documentId,
1594             @WebParam(name = "roleName") String roleName,
1595             @WebParam(name = "qualifiedRoleNameLabel") String qualifiedRoleNameLabel)
1596             throws RiceIllegalArgumentException;
1597 
1598     /**
1599      * Executes a simulation of a document to get all previous and future route information
1600      *
1601      * @param reportCriteria criteria for the simulation to follow
1602      *
1603      * @return DocumentDetail object representing the results of the simulation
1604      *
1605      * @throws RiceIllegalArgumentException if {@code reportCriteria} is null
1606      */
1607     @WebMethod(operationName = "executeSimulation")
1608     @WebResult(name = "documentDetail")
1609     DocumentDetail executeSimulation(
1610             @WebParam(name = "reportCriteria") RoutingReportCriteria reportCriteria)
1611             throws RiceIllegalArgumentException;
1612 
1613     /**
1614      * Determines if a passed in user is the final approver for a document
1615      *
1616      * @param documentId unique Id of the document
1617      * @param principalId unique Id of Principal to look for in document's route log
1618      *
1619      * @return boolean value representing if a principal is the final approver for a document
1620      *
1621      * @throws RiceIllegalArgumentException if {@code documentId} is null
1622      * @throws RiceIllegalArgumentException if {@code principalId} is null
1623      */
1624     @WebMethod(operationName = "isFinalApprover")
1625     @WebResult(name = "finalApprover")
1626     boolean isFinalApprover(
1627             @WebParam(name = "documentId") String documentId,
1628             @WebParam(name = "principalId") String principalId)
1629             throws RiceIllegalArgumentException;
1630 
1631     /**
1632      * Determines if a passed in user is the last approver at a specified route node
1633      *
1634      * @param documentId unique Id of the document
1635      * @param principalId unique Id of Principal to look for in document's route log
1636      * @param nodeName name of route node to determine last approver for
1637      *
1638      * @return boolean value representing if a principal is the last approver at the specified route node
1639      *
1640      * @throws RiceIllegalArgumentException if {@code documentId} is null
1641      * @throws RiceIllegalArgumentException if {@code principalId} is null
1642      * @throws RiceIllegalArgumentException if {@code nodeName} is null
1643      */
1644     @WebMethod(operationName = "isLastApproverAtNode")
1645     @WebResult(name = "lastApproverAtNode")
1646     boolean isLastApproverAtNode(
1647             @WebParam(name = "documentId") String documentId,
1648             @WebParam(name = "principalId") String principalId,
1649             @WebParam(name = "nodeName") String nodeName)
1650             throws RiceIllegalArgumentException;
1651 
1652     /**
1653      * Determines if a route node has an 'approve action' request
1654      *
1655      * @param docType document type of document
1656      * @param docContent string representing content of document
1657      * @param nodeName name of route node to determine if approve action request exists
1658      *
1659      * @return boolean value representing if a route node has an 'approve action' request
1660      *
1661      * @throws RiceIllegalArgumentException if {@code docType} is null
1662      * @throws RiceIllegalArgumentException if {@code docContent} is null
1663      * @throws RiceIllegalArgumentException if {@code nodeName} is null
1664      */
1665     @WebMethod(operationName = "routeNodeHasApproverActionRequest")
1666     @WebResult(name = "routeNodeHasApproverActionRequest")
1667     boolean routeNodeHasApproverActionRequest(
1668             @WebParam(name = "docType") String docType,
1669             @WebParam(name = "docContent") String docContent,
1670             @WebParam(name = "nodeName") String nodeName)
1671             throws RiceIllegalArgumentException;
1672 
1673     /**
1674      * Determines if a document has at least one action request
1675      *
1676      * @param reportCriteria criteria for routing report
1677      * @param actionRequestedCodes list of action request codes to see if they exist for the document
1678      * @param ignoreCurrentActionRequests boolean value to determine if current action requests should be ignored
1679      *
1680      * @return boolean value representing if a document will have at least one action request
1681      *
1682      * @throws RiceIllegalArgumentException if {@code docType} is null
1683      * @throws RiceIllegalArgumentException if {@code docContent} is null
1684      * @throws RiceIllegalArgumentException if {@code nodeName} is null
1685      */
1686     @WebMethod(operationName = "documentWillHaveAtLeastOneActionRequest")
1687     @WebResult(name = "documentWillHaveAtLeastOneActionRequest")
1688     boolean documentWillHaveAtLeastOneActionRequest(
1689             @WebParam(name = "reportCriteria") RoutingReportCriteria reportCriteria,
1690             @WebParam(name = "actionRequestedCodes") List<String> actionRequestedCodes,
1691             @WebParam(name = "ignoreCurrentActionRequests") boolean ignoreCurrentActionRequests)
1692             throws RiceIllegalArgumentException;
1693 
1694     /**
1695      * Returns a list of principal Ids that exist in a route log
1696      *
1697      * @param documentId unique id of the document to get the route log for
1698      * @param lookFuture boolean value that determines if the method should look at future action requests
1699      *
1700      * @return list of principal ids that exist in a route log
1701      *
1702      * @throws RiceIllegalArgumentException if {@code documentId} is null
1703      */
1704     @WebMethod(operationName = "getPrincipalIdsInRouteLog")
1705     @WebResult(name = "principalIds")
1706     @XmlElementWrapper(name = "principalIds", required = true)
1707     @XmlElement(name = "principalId", required = true)
1708     List<String> getPrincipalIdsInRouteLog(
1709             @WebParam(name = "documentId") String documentId,
1710             @WebParam(name = "lookFuture") boolean lookFuture)
1711             throws RiceIllegalArgumentException;
1712 
1713 }