Coverage Report - org.kuali.rice.kns.workflow.service.WorkflowDocumentService
 
Classes in this File Line Coverage Branch Coverage Complexity
WorkflowDocumentService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  * 
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  * 
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kns.workflow.service;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import org.kuali.rice.kew.exception.ResourceUnavailableException;
 21  
 import org.kuali.rice.kew.exception.WorkflowException;
 22  
 import org.kuali.rice.kim.bo.Person;
 23  
 
 24  
 
 25  
 /**
 26  
  * This interface defines the contract that must be implemented by the workflow engine.
 27  
  * 
 28  
  * 
 29  
  */
 30  
 public interface WorkflowDocumentService {
 31  
     /**
 32  
      * @param documentHeaderId
 33  
      * @return true if a workflowDocument exists for the given documentHeaderId
 34  
      */
 35  
     public boolean workflowDocumentExists(String documentHeaderId);
 36  
 
 37  
 
 38  
     /**
 39  
      * Given a documentTypeId and workflowUser, returns a new workflowDocument from the workflow server.
 40  
      * 
 41  
      * @param documentTypeId
 42  
      * @param workflowUser
 43  
      * @return newly-created workflowDocument instance
 44  
      * @throws IllegalArgumentException if the given documentTypeId is blank
 45  
      * @throws IllegalArgumentException if the given workflowUser is null or contains no id
 46  
      * @throws ResourceUnavailableException
 47  
      */
 48  
     public KualiWorkflowDocument createWorkflowDocument(String documentTypeId, Person workflowUser) throws WorkflowException;
 49  
 
 50  
     /**
 51  
      * Given a documentHeaderId and workflowUser, retrieves the workflowDocument associated with that documentHeaderId from the workflow
 52  
      * server.
 53  
      * 
 54  
      * @param documentHeaderId
 55  
      * @param workflowUser
 56  
      * @return existing workflowDoc
 57  
      * @throws IllegalArgumentException if the given documentHeaderId is null
 58  
      * @throws IllegalArgumentException if the given workflowUser is null or contains no id
 59  
      */
 60  
     public KualiWorkflowDocument createWorkflowDocument(Long documentHeaderId, Person workflowUser) throws WorkflowException;
 61  
 
 62  
     /**
 63  
      * This method will first determine if the {@link KualiWorkflowDocument#saveDocument(String)} method is valid to be called.  If so the method
 64  
      * will save the document to workflows action list optionally providing an annotation which will show up in the route log for this
 65  
      * document corresponding to this action taken.  If the KualiWorkflowDocument.saveDocument() method is not valid to be called the system 
 66  
      * will instead call the method {@link WorkflowDocumentService#saveRoutingData(KualiWorkflowDocument)}
 67  
      * 
 68  
      * @param workflowDocument
 69  
      * @param annotation
 70  
      * @throws WorkflowException
 71  
      */
 72  
     public void save(KualiWorkflowDocument workflowDocument, String annotation) throws WorkflowException;
 73  
 
 74  
     /**
 75  
      * save the routing data of the document to workflow
 76  
      * 
 77  
      * @param workflowDocument
 78  
      * @throws WorkflowException
 79  
      */
 80  
     public void saveRoutingData(KualiWorkflowDocument workflowDocument) throws WorkflowException;
 81  
 
 82  
     /**
 83  
      * route this workflowDocument optionally providing an annotation for this action taken which will show up in the route log for this
 84  
      * document corresponding to this action taken, and additionally optionally providing a list of ad hoc recipients for the
 85  
      * document
 86  
      * 
 87  
      * @param workflowDocument
 88  
      * @param annotation
 89  
      * @param adHocRecipients
 90  
      */
 91  
     public void route(KualiWorkflowDocument workflowDocument, String annotation, List adHocRecipients) throws WorkflowException;
 92  
 
 93  
     /**
 94  
      * approve this workflowDocument optionally providing an annotation for this action taken which will show up in the route log for this
 95  
      * document corresponding to this action taken, and additionally optionally providing a list of ad hoc recipients for the
 96  
      * document
 97  
      * 
 98  
      * @param workflowDocument
 99  
      * @param annotation
 100  
      * @param adHocRecipients
 101  
      */
 102  
     public void approve(KualiWorkflowDocument workflowDocument, String annotation, List adHocRecipients) throws WorkflowException;
 103  
 
 104  
     /**
 105  
      * super user approve this workflowDocument optionally providing an annotation for this action taken which will show up in the route log
 106  
      * for this document corresponding to this action taken
 107  
      * 
 108  
      * @param workflowDocument
 109  
      * @param annotation
 110  
      * @param adHocRecipients
 111  
      */
 112  
     public void superUserApprove(KualiWorkflowDocument workflowDocument, String annotation) throws WorkflowException;
 113  
 
 114  
     /**
 115  
      * super user cancel this workflowDocument optionally providing an annotation for this action taken which will show up in the route log
 116  
      * for this document corresponding to this action taken
 117  
      * 
 118  
      * @param workflowDocument
 119  
      * @param annotation
 120  
      * @throws WorkflowException
 121  
      */
 122  
     public void superUserCancel(KualiWorkflowDocument workflowDocument, String annotation) throws WorkflowException;
 123  
 
 124  
     /**
 125  
      * super user disapprove this workflowDocument optionally providing an annotation for this action taken which will show up in the route log
 126  
      * for this document corresponding to this action taken
 127  
      * 
 128  
      * @param workflowDocument
 129  
      * @param annotation
 130  
      * @throws WorkflowException
 131  
      */
 132  
     public void superUserDisapprove(KualiWorkflowDocument workflowDocument, String annotation) throws WorkflowException;
 133  
 
 134  
     /**
 135  
      * disapprove this workflowDocument optionally providing an annotation for this action taken which will show up in the route log for this
 136  
      * document corresponding to this action taken
 137  
      * 
 138  
      * @param workflowDocument
 139  
      * @param annotation
 140  
      */
 141  
     public void disapprove(KualiWorkflowDocument workflowDocument, String annotation) throws WorkflowException;
 142  
 
 143  
     /**
 144  
      * cancel this workflowDocument optionally providing an annotation for this action taken which will show up in the route log for this
 145  
      * document corresponding to this action taken
 146  
      * 
 147  
      * @param workflowDocument
 148  
      * @param annotation
 149  
      */
 150  
     public void cancel(KualiWorkflowDocument workflowDocument, String annotation) throws WorkflowException;
 151  
 
 152  
     /**
 153  
      * acknowledge this workflowDocument optionally providing an annotation for this action taken which will show up in the route log for
 154  
      * this document corresponding to this action taken, additionally optionally providing a list of ad hoc recipients for this
 155  
      * document which should be restricted to actions requested of acknowledge or fyi as all other action request types will be
 156  
      * discarded
 157  
      * 
 158  
      * @param workflowDocument
 159  
      * @param annotation
 160  
      * @param adHocRecipients
 161  
      */
 162  
     public void acknowledge(KualiWorkflowDocument workflowDocument, String annotation, List adHocRecipients) throws WorkflowException;
 163  
 
 164  
     /**
 165  
      * blanket approve this document optionally providing an annotation for this action taken which will show up in the route log
 166  
      * for this document corresponding to this action taken, and additionally optionally providing a list of ad hoc recipients for
 167  
      * this document which should be restricted to actions requested of acknowledge or fyi as all other action request types will be
 168  
      * discarded.
 169  
      * 
 170  
      * @param workflowDocument
 171  
      * @param annotation
 172  
      * @param adHocRecipients
 173  
      */
 174  
     public void blanketApprove(KualiWorkflowDocument workflowDocument, String annotation, List adHocRecipients) throws WorkflowException;
 175  
 
 176  
     /**
 177  
      * clear the fyi request for this document, optinoally providing a list of ad hoc recipients for this document which should be
 178  
      * restricted to actions requested of fyi as all other action request types will be discarded
 179  
      * 
 180  
      * @param workflowDocument
 181  
      * @param adHocRecipients
 182  
      */
 183  
     public void clearFyi(KualiWorkflowDocument workflowDocument, List adHocRecipients) throws WorkflowException;
 184  
     
 185  
     /**
 186  
      * Gets the current route level name of the workflow document even if document has no active node
 187  
      * names.  Allows for getting the node name of a document already in a final status.
 188  
      * 
 189  
      * @param workflowDocument
 190  
      * @return node name of the current node if only one or list of node names separated by string ", " if more than one current node name 
 191  
      * @throws WorkflowException
 192  
      */
 193  
     public String getCurrentRouteLevelName(KualiWorkflowDocument workflowDocument) throws WorkflowException;
 194  
     
 195  
     /**
 196  
      * Sends workflow notification to the list of ad hoc recipients.  This method is usually used to notify users of a note that has been added to a
 197  
      * document.  The notificationLabel parameter is used to give the request a custom label in the user's Action List
 198  
      * 
 199  
      * @param workflowDocument
 200  
      * @param annotation
 201  
      * @param adHocRecipients
 202  
      * @param notificationLabel
 203  
      * @throws WorkflowException
 204  
      */
 205  
     public void sendWorkflowNotification(KualiWorkflowDocument workflowDocument, String annotation, List adHocRecipients, String notificationLabel) throws WorkflowException;
 206  
     
 207  
     /**
 208  
      * Sends workflow notification to the list of ad hoc recipients.  This method is usually used to notify users of a note that has been added to a
 209  
      * document
 210  
      * 
 211  
      * @param workflowDocument
 212  
      * @param annotation
 213  
      * @param adHocRecipients
 214  
      * @throws WorkflowException
 215  
      */
 216  
     public void sendWorkflowNotification(KualiWorkflowDocument workflowDocument, String annotation, List adHocRecipients) throws WorkflowException;
 217  
 }