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