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