1 /*
2 * Copyright 2005-2007 The Kuali Foundation
3 *
4 *
5 * Licensed under the Educational Community License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.opensource.org/licenses/ecl2.php
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.kuali.rice.kew.postprocessor;
18
19 import java.util.List;
20
21
22
23 /**
24 * Hook for applications to perform logic due to workflow events from the engine.
25 *
26 * @author Kuali Rice Team (rice.collab@kuali.org)
27 */
28 public interface PostProcessor {
29
30 /**
31 * Executed whenever the status of the document changes.
32 *
33 * @return ProcessDocReport indicating if the status change succeeded
34 */
35 public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception;
36
37 /**
38 * Executed whenever the document transitions from one node to another.
39 *
40 * @return ProcessDocReport indicating if the node transition succeeded
41 */
42 public ProcessDocReport doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) throws Exception;
43
44 /**
45 * Executed whenever a deletion of the document is required.
46 *
47 * @return ProcessDocReport indicating if the deletion should be permitted to occur or not
48 */
49 public ProcessDocReport doDeleteRouteHeader(DeleteEvent event) throws Exception;
50
51 /**
52 * Executed whenever an action is taken against the document.
53 *
54 * @return ProcessDocReport indicating whether or not the action should succeed
55 */
56 public ProcessDocReport doActionTaken(ActionTakenEvent event) throws Exception;
57
58 /**
59 * Executed prior to processing by the workflow engine.
60 *
61 * @return ProcessDocReport indicating whether or not the document processing should be allowed to proceed
62 */
63 public ProcessDocReport beforeProcess(BeforeProcessEvent processEvent) throws Exception;
64
65 /**
66 * Executed after processing by the workflow engine has completed.
67 *
68 * @return ProcessDocReport indicating whether or not the document was successfully processed
69 */
70 public ProcessDocReport afterProcess(AfterProcessEvent processEvent) throws Exception;
71
72 /**
73 * Executed prior to document locking in the workflow engine. This method returns a List of document
74 * ids to lock prior to execution of the document in the workflow engine. If the engine processing is
75 * going to result in updates to any other documents, they should be locked at the beginning of the engine
76 * processing transaction. This method facilitates that.
77 *
78 * <p>Note that, by default, the id of the document that is being processed by the engine is always
79 * locked. So there is no need to return that document id in the list of document ids to lock.
80 *
81 * @return a List of document ids to lock prior to execution of the workflow engine
82 */
83 public List<String> getDocumentIdsToLock(DocumentLockingEvent lockingEvent) throws Exception;
84
85 }