01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.kra.routingform.rules.event;
17:
18: import org.kuali.core.document.Document;
19: import org.kuali.core.rule.BusinessRule;
20: import org.kuali.core.rule.event.KualiDocumentEvent;
21: import org.kuali.core.rule.event.KualiDocumentEventBase;
22: import org.kuali.module.kra.routingform.document.RoutingFormDocument;
23: import org.kuali.module.kra.routingform.rules.RoutingFormDocumentRule;
24:
25: /**
26: * Class capturing a run audit event.
27: */
28: public class RoutingFormBudgetLinkEvent extends KualiDocumentEventBase
29: implements KualiDocumentEvent {
30:
31: private String[] selectedBudgetPeriods;
32: private boolean allPeriods;
33: private boolean checkPeriods;
34:
35: /**
36: * Constructs a RunAuditEvent with the given errorPathPrefix and document.
37: *
38: * @param errorPathPrefix
39: * @param document
40: * @param accountingLine
41: */
42: public RoutingFormBudgetLinkEvent(String errorPathPrefix,
43: Document document) {
44: super ("Linking Budget to " + getDocumentId(document),
45: errorPathPrefix, document);
46: }
47:
48: /**
49: * Constructs a RunAuditEvent with the given document.
50: *
51: * @param errorPathPrefix
52: * @param document
53: * @param accountingLine
54: */
55: public RoutingFormBudgetLinkEvent(
56: RoutingFormDocument routingFormDocument,
57: String[] selectedBudgetPeriods, boolean allPeriods,
58: boolean checkPeriods) {
59: this ("", routingFormDocument);
60: this .selectedBudgetPeriods = selectedBudgetPeriods;
61: this .allPeriods = allPeriods;
62: this .checkPeriods = checkPeriods;
63:
64: }
65:
66: /**
67: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
68: */
69: public Class getRuleInterfaceClass() {
70: return RoutingFormDocumentRule.class;
71: }
72:
73: /**
74: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
75: */
76: public boolean invokeRuleMethod(BusinessRule rule) {
77: return ((RoutingFormDocumentRule) rule)
78: .processBudgetRoutingFormLink(
79: ((RoutingFormDocument) this.getDocument()),
80: selectedBudgetPeriods, allPeriods, checkPeriods);
81: }
82: }
|