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