1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.rule; |
18 | |
|
19 | |
import org.kuali.rice.kew.postprocessor.DefaultPostProcessor; |
20 | |
import org.kuali.rice.kew.postprocessor.DeleteEvent; |
21 | |
import org.kuali.rice.kew.postprocessor.DocumentRouteLevelChange; |
22 | |
import org.kuali.rice.kew.postprocessor.DocumentRouteStatusChange; |
23 | |
import org.kuali.rice.kew.postprocessor.PostProcessor; |
24 | |
import org.kuali.rice.kew.postprocessor.ProcessDocReport; |
25 | |
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; |
26 | |
import org.kuali.rice.kew.routeheader.service.RouteHeaderService; |
27 | |
import org.kuali.rice.kew.rule.service.RuleService; |
28 | |
import org.kuali.rice.kew.service.KEWServiceLocator; |
29 | |
import org.kuali.rice.kew.util.KEWConstants; |
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | 0 | public class RulePostProcessor extends DefaultPostProcessor { |
41 | |
|
42 | |
public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception { |
43 | 0 | DocumentRouteHeaderValue routeHeader = getRouteHeaderService().getRouteHeader(statusChangeEvent.getDocumentId()); |
44 | |
|
45 | 0 | if (KEWConstants.ROUTE_HEADER_PROCESSED_CD.equals(routeHeader.getDocRouteStatus())) { |
46 | 0 | getRuleService().makeCurrent(routeHeader.getDocumentId()); |
47 | |
} |
48 | 0 | return new ProcessDocReport(true, ""); |
49 | |
} |
50 | |
|
51 | |
public ProcessDocReport doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) throws Exception { |
52 | 0 | return new ProcessDocReport(true, ""); |
53 | |
} |
54 | |
|
55 | |
public ProcessDocReport doDeleteRouteHeader(DeleteEvent event) throws Exception { |
56 | 0 | return new ProcessDocReport(true, ""); |
57 | |
} |
58 | |
|
59 | |
public String getVersion() throws Exception { |
60 | 0 | return ""; |
61 | |
} |
62 | |
|
63 | |
private RouteHeaderService getRouteHeaderService() { |
64 | 0 | return (RouteHeaderService) KEWServiceLocator.getService(KEWServiceLocator.DOC_ROUTE_HEADER_SRV); |
65 | |
} |
66 | |
|
67 | |
private RuleService getRuleService() { |
68 | 0 | return (RuleService) KEWServiceLocator.getService(KEWServiceLocator.RULE_SERVICE); |
69 | |
} |
70 | |
|
71 | |
} |