View Javadoc
1   /**
2    * Copyright 2005-2015 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.kew.framework.postprocessor;
17  
18  import org.kuali.rice.kew.api.action.ActionType;
19  
20  import java.util.List;
21  
22  
23  
24  /**
25   * Hook for applications to perform logic due to workflow events from the engine.
26   * 
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public interface PostProcessor {
30  
31  	/**
32  	 * Executed whenever the status of the document changes.
33  	 * 
34  	 * @return ProcessDocReport indicating if the status change succeeded
35  	 */
36      public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception;
37      
38      /**
39  	 * Executed whenever the document transitions from one node to another.
40  	 * 
41  	 * @return ProcessDocReport indicating if the node transition succeeded
42  	 */
43      public ProcessDocReport doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) throws Exception;
44      
45      /**
46  	 * Executed whenever a deletion of the document is required.
47  	 * 
48  	 * @return ProcessDocReport indicating if the deletion should be permitted to occur or not
49  	 */
50      public ProcessDocReport doDeleteRouteHeader(DeleteEvent event) throws Exception;
51      
52      /**
53       * Executed whenever an action is taken against the document.
54       * 
55       * @return ProcessDocReport indicating whether or not the action should succeed
56       */
57      public ProcessDocReport doActionTaken(ActionTakenEvent event) throws Exception;
58  
59      /**
60       * Executed after an action is taken against the document.
61       *
62       * @return ProcessDocReport indicating whether or not the action was successful
63       * @since 2.1
64       */
65      public ProcessDocReport afterActionTaken(ActionType actionPerformed, ActionTakenEvent event) throws Exception;
66      
67      /**
68       * Executed prior to processing by the workflow engine.
69       *
70       * @return ProcessDocReport indicating whether or not the document processing should be allowed to proceed
71       */
72      public ProcessDocReport beforeProcess(BeforeProcessEvent processEvent) throws Exception;
73  
74      /**
75       * Executed after processing by the workflow engine has completed.
76       *
77       * @return ProcessDocReport indicating whether or not the document was successfully processed
78       */
79      public ProcessDocReport afterProcess(AfterProcessEvent processEvent) throws Exception;
80      
81      /**
82       * Executed prior to document locking in the workflow engine.  This method returns a List of document
83       * ids to lock prior to execution of the document in the workflow engine.  If the engine processing is
84       * going to result in updates to any other documents, they should be locked at the beginning of the engine
85       * processing transaction.  This method facilitates that.
86       * 
87       * <p>Note that, by default, the id of the document that is being processed by the engine is always
88       * locked.  So there is no need to return that document id in the list of document ids to lock.
89       * 
90       * @return a List of document ids to lock prior to execution of the workflow engine
91       */
92      public List<String> getDocumentIdsToLock(DocumentLockingEvent lockingEvent) throws Exception;
93      
94  }