View Javadoc

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;
17  
18  import java.util.List;
19  import java.util.Set;
20  
21  import org.joda.time.DateTime;
22  import org.kuali.rice.kew.api.action.ActionRequest;
23  import org.kuali.rice.kew.api.action.ActionRequestType;
24  import org.kuali.rice.kew.api.action.ActionTaken;
25  import org.kuali.rice.kew.api.action.ActionType;
26  import org.kuali.rice.kew.api.action.AdHocRevoke;
27  import org.kuali.rice.kew.api.action.MovePoint;
28  import org.kuali.rice.kew.api.action.RequestedActions;
29  import org.kuali.rice.kew.api.action.ReturnPoint;
30  import org.kuali.rice.kew.api.action.ValidActions;
31  import org.kuali.rice.kew.api.document.Document;
32  import org.kuali.rice.kew.api.document.DocumentContent;
33  import org.kuali.rice.kew.api.document.DocumentContentUpdate;
34  import org.kuali.rice.kew.api.document.DocumentContract;
35  import org.kuali.rice.kew.api.document.DocumentDetail;
36  import org.kuali.rice.kew.api.document.DocumentStatus;
37  import org.kuali.rice.kew.api.document.attribute.WorkflowAttributeDefinition;
38  import org.kuali.rice.kew.api.document.attribute.WorkflowAttributeValidationError;
39  import org.kuali.rice.kew.api.document.node.RouteNodeInstance;
40  
41  /**
42   * TODO ..
43   * 
44   * TODO - it is intended that operations against document data on this are only "flushed" when an action is performed...
45   * 
46   * <p>This class is *not* thread safe.
47   *
48   */
49  public interface WorkflowDocument extends DocumentContract {
50  
51  	String getDocumentId();
52  
53  	Document getDocument();
54  
55  	DocumentContent getDocumentContent();
56  
57  	String getApplicationContent();
58  
59  	void setApplicationContent(String applicationContent);
60  
61      public void setAttributeContent(String attributeContent);
62  	
63  	void clearAttributeContent();
64  
65  	String getAttributeContent();
66  
67  	void addAttributeDefinition(WorkflowAttributeDefinition attributeDefinition);
68  
69  	void removeAttributeDefinition(
70  			WorkflowAttributeDefinition attributeDefinition);
71  
72  	void clearAttributeDefinitions();
73  
74  	List<WorkflowAttributeDefinition> getAttributeDefinitions();
75  
76  	public void setSearchableContent(String searchableContent);
77  	
78  	void addSearchableDefinition(
79  			WorkflowAttributeDefinition searchableDefinition);
80  
81  	void removeSearchableDefinition(
82  			WorkflowAttributeDefinition searchableDefinition);
83  
84  	void clearSearchableDefinitions();
85  
86  	void clearSearchableContent();
87  
88  	List<WorkflowAttributeDefinition> getSearchableDefinitions();
89  
90  	List<WorkflowAttributeValidationError> validateAttributeDefinition(
91  			WorkflowAttributeDefinition attributeDefinition);
92  
93  	List<ActionRequest> getRootActionRequests();
94  
95  	List<ActionTaken> getActionsTaken();
96  
97  	void setApplicationDocumentId(String applicationDocumentId);
98  
99  	String getApplicationDocumentId();
100 
101 	DateTime getDateCreated();
102 
103 	String getTitle();
104 
105 	ValidActions getValidActions();
106 
107 	RequestedActions getRequestedActions();
108 
109 	void saveDocument(String annotation);
110 
111 	void route(String annotation);
112 
113 	void disapprove(String annotation);
114 
115 	void approve(String annotation);
116 
117 	void cancel(String annotation);
118 
119 	void blanketApprove(String annotation);
120 
121 	void blanketApprove(String annotation, String... nodeNames);
122 
123 	void saveDocumentData();
124 
125 	void setApplicationDocumentStatus(String applicationDocumentStatus);
126 
127 	void acknowledge(String annotation);
128 
129 	void fyi(String annotation);
130 
131 	void fyi();
132 
133 	/**
134 	 * TODO - be sure to mention that once this document is deleted, this api effectively becomes "dead" when you try to
135 	 * execute any document operation
136 	 */
137 	void delete();
138 
139 	void refresh();
140 
141 	void adHocToPrincipal(ActionRequestType actionRequested, String annotation,
142 			String targetPrincipalId, String responsibilityDescription,
143 			boolean forceAction);
144 
145 	void adHocToPrincipal(ActionRequestType actionRequested, String nodeName,
146 			String annotation, String targetPrincipalId,
147 			String responsibilityDescription, boolean forceAction);
148 
149 	void adHocToPrincipal(ActionRequestType actionRequested, String nodeName,
150 			String annotation, String targetPrincipalId,
151 			String responsibilityDescription, boolean forceAction,
152 			String requestLabel);
153 
154 	void adHocToGroup(ActionRequestType actionRequested, String annotation,
155 			String targetGroupId, String responsibilityDescription,
156 			boolean forceAction);
157 
158 	void adHocToGroup(ActionRequestType actionRequested, String nodeName,
159 			String annotation, String targetGroupId,
160 			String responsibilityDescription, boolean forceAction);
161 
162 	void adHocToGroup(ActionRequestType actionRequested, String nodeName,
163 			String annotation, String targetGroupId,
164 			String responsibilityDescription, boolean forceAction,
165 			String requestLabel);
166 
167 	void revokeAdHocRequestById(String actionRequestId, String annotation);
168 
169 	void revokeAdHocRequests(AdHocRevoke revoke, String annotation);
170 
171 	void revokeAllAdHocRequests(String annotation);
172 
173 	void setTitle(String title);
174 
175 	String getDocumentTypeName();
176 
177 	boolean isCompletionRequested();
178 
179 	boolean isApprovalRequested();
180 
181 	boolean isAcknowledgeRequested();
182 
183 	boolean isFYIRequested();
184 
185 	boolean isBlanketApproveCapable();
186 
187 	boolean isRouteCapable();
188 
189 	boolean isValidAction(ActionType actionType);
190 
191 	void superUserBlanketApprove(String annotation);
192 
193 	void superUserNodeApprove(String nodeName, String annotation);
194 
195 	void superUserTakeRequestedAction(String actionRequestId, String annotation);
196 
197 	void superUserDisapprove(String annotation);
198 
199 	void superUserCancel(String annotation);
200 
201 	void superUserReturnToPreviousNode(ReturnPoint returnPoint,
202 			String annotation);
203 
204 	void complete(String annotation);
205 
206 	void logAnnotation(String annotation);
207 
208 	DocumentStatus getStatus();
209 
210 	boolean checkStatus(DocumentStatus status);
211 
212 	/**
213 	 * Indicates if the document is in the initiated state or not.
214 	 *
215 	 * @return true if in the specified state
216 	 */
217 	boolean isInitiated();
218 
219 	/**
220 	 * Indicates if the document is in the saved state or not.
221 	 *
222 	 * @return true if in the specified state
223 	 */
224 	boolean isSaved();
225 
226 	/**
227 	 * Indicates if the document is in the enroute state or not.
228 	 *
229 	 * @return true if in the specified state
230 	 */
231 	boolean isEnroute();
232 
233 	/**
234 	 * Indicates if the document is in the exception state or not.
235 	 *
236 	 * @return true if in the specified state
237 	 */
238 	boolean isException();
239 
240 	/**
241 	 * Indicates if the document is in the canceled state or not.
242 	 *
243 	 * @return true if in the specified state
244 	 */
245 	boolean isCanceled();
246 
247 	/**
248 	 * Indicates if the document is in the disapproved state or not.
249 	 *
250 	 * @return true if in the specified state
251 	 */
252 	boolean isDisapproved();
253 
254 	/**
255 	 * Indicates if the document is in the Processed or Finalized state.
256 	 *
257 	 * @return true if in the specified state
258 	 */
259 	boolean isApproved();
260 
261 	/**
262 	 * Indicates if the document is in the processed state or not.
263 	 *
264 	 * @return true if in the specified state
265 	 */
266 	boolean isProcessed();
267 
268 	/**
269 	 * Indicates if the document is in the final state or not.
270 	 *
271 	 * @return true if in the specified state
272 	 */
273 	boolean isFinal();
274 
275 	/**
276 	 * Returns the principalId with which this WorkflowDocument was constructed
277 	 * 
278 	 * @return the principalId with which this WorkflowDocument was constructed
279 	 */
280 	String getPrincipalId();
281 
282 	void switchPrincipal(String principalId);
283 
284 	void takeGroupAuthority(String annotation, String groupId);
285 
286 	void releaseGroupAuthority(String annotation, String groupId);
287 
288 	Set<String> getNodeNames();
289 
290 	void returnToPreviousNode(String nodeName, String annotation);
291 
292 	void returnToPreviousNode(ReturnPoint returnPoint, String annotation);
293 
294 	void move(MovePoint movePoint, String annotation);
295 
296 	List<RouteNodeInstance> getActiveRouteNodeInstances();
297 
298 	List<RouteNodeInstance> getRouteNodeInstances();
299 
300 	List<String> getPreviousNodeNames();
301 
302 	DocumentDetail getDocumentDetail();
303 
304 	void updateDocumentContent(DocumentContentUpdate documentContentUpdate);
305 
306 	void placeInExceptionRouting(String annotation);
307 
308 	void setVariable(String name, String value);
309 
310 	String getVariableValue(String name);
311 
312 	void setReceiveFutureRequests();
313 
314 	void setDoNotReceiveFutureRequests();
315 
316 	void setClearFutureRequests();
317 
318 	String getReceiveFutureRequestsValue();
319 
320 	String getDoNotReceiveFutureRequestsValue();
321 
322 	String getClearFutureRequestsValue();
323 
324 }