View Javadoc

1   /**
2    * Copyright 2005-2013 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.krad.workflow.postprocessor;
17  
18  import org.apache.log4j.Logger;
19  import org.kuali.rice.kew.api.action.ActionType;
20  import org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent;
21  import org.kuali.rice.kew.framework.postprocessor.AfterProcessEvent;
22  import org.kuali.rice.kew.framework.postprocessor.BeforeProcessEvent;
23  import org.kuali.rice.kew.framework.postprocessor.DeleteEvent;
24  import org.kuali.rice.kew.framework.postprocessor.DocumentLockingEvent;
25  import org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange;
26  import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange;
27  import org.kuali.rice.kew.framework.postprocessor.PostProcessor;
28  import org.kuali.rice.kew.framework.postprocessor.ProcessDocReport;
29  import org.kuali.rice.krad.service.KRADServiceLocatorInternal;
30  
31  import java.util.List;
32  
33  
34  /**
35   * 
36   * This class is the public entry point by which workflow communicates status changes, 
37   * level changes, and other useful changes.
38   * 
39   * Note that this class delegates all of these activities to the PostProcessorService, 
40   * which does the actual work.  This is done to ensure proper transaction scoping, and 
41   * to resolve some issues present otherwise.
42   * 
43   * Because of this, its important to understand that a transaction will be started at 
44   * the PostProcessorService method call, so any work that needs to be done within the 
45   * same transaction needs to happen inside that service implementation, rather than 
46   * in here.
47   * 
48   */
49  public class KualiPostProcessor implements PostProcessor {
50  
51      private static Logger LOG = Logger.getLogger(KualiPostProcessor.class);
52  
53      /**
54       * 
55       * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#doRouteStatusChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange)
56       */
57      @Override
58      public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception {
59          return KRADServiceLocatorInternal.getPostProcessorService().doRouteStatusChange(statusChangeEvent);
60      }
61  
62      /**
63       * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#doActionTaken(org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent)
64       */
65      @Override
66      public ProcessDocReport doActionTaken(ActionTakenEvent event) throws Exception {
67          return KRADServiceLocatorInternal.getPostProcessorService().doActionTaken(event);
68      }
69  
70      /**
71       * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#afterActionTaken(org.kuali.rice.kew.api.action.ActionType, org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent)
72       */
73      @Override
74      public ProcessDocReport afterActionTaken(ActionType performed, ActionTakenEvent event) throws Exception {
75          return KRADServiceLocatorInternal.getPostProcessorService().afterActionTaken(performed, event);
76      }
77  
78      /**
79       * 
80       * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#doDeleteRouteHeader(org.kuali.rice.kew.framework.postprocessor.DeleteEvent)
81       */
82      @Override
83      public ProcessDocReport doDeleteRouteHeader(DeleteEvent event) throws Exception {
84          return KRADServiceLocatorInternal.getPostProcessorService().doDeleteRouteHeader(event);
85      }
86  
87      /**
88       * 
89       * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#doRouteLevelChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange)
90       */
91      @Override
92      public ProcessDocReport doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) throws Exception {
93          return KRADServiceLocatorInternal.getPostProcessorService().doRouteLevelChange(levelChangeEvent);
94      }
95  
96      /**
97       * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#beforeProcess(org.kuali.rice.kew.framework.postprocessor.BeforeProcessEvent)
98       */
99      @Override
100     public ProcessDocReport beforeProcess(BeforeProcessEvent beforeProcessEvent) throws Exception {
101         return KRADServiceLocatorInternal.getPostProcessorService().beforeProcess(beforeProcessEvent);
102     }
103 
104     /**
105      * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#afterProcess(org.kuali.rice.kew.framework.postprocessor.AfterProcessEvent)
106      */
107     @Override
108     public ProcessDocReport afterProcess(AfterProcessEvent afterProcessEvent) throws Exception {
109         return KRADServiceLocatorInternal.getPostProcessorService().afterProcess(afterProcessEvent);
110     }
111 
112     /**
113      * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#getDocumentIdsToLock(org.kuali.rice.kew.framework.postprocessor.DocumentLockingEvent)
114      */
115     @Override
116 	public List<String> getDocumentIdsToLock(DocumentLockingEvent documentLockingEvent) throws Exception {
117 		return KRADServiceLocatorInternal.getPostProcessorService().getDocumentIdsToLock(documentLockingEvent);
118 	}
119 
120 }