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.financial.rule.event;
17:
18: import org.kuali.core.document.Document;
19: import org.kuali.core.rule.BusinessRule;
20: import org.kuali.kfs.document.AccountingDocument;
21: import org.kuali.module.financial.bo.Check;
22: import org.kuali.module.financial.rule.AddCheckRule;
23:
24: /**
25: * This class represents the add check event. This could be triggered when a user presses the add button for a given document's
26: * check line.
27: */
28: public final class AddCheckEvent extends CheckEventBase {
29: /**
30: * Constructs an AddCheckEvent with the given errorPathPrefix, document, and accountingLine.
31: *
32: * @param errorPathPrefix
33: * @param document
34: * @param accountingLine
35: */
36: public AddCheckEvent(String errorPathPrefix, Document document,
37: Check check) {
38: super ("adding check to document " + getDocumentId(document),
39: errorPathPrefix, document, check);
40: }
41:
42: /**
43: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
44: */
45: public Class getRuleInterfaceClass() {
46: return AddCheckRule.class;
47: }
48:
49: /**
50: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
51: */
52: public boolean invokeRuleMethod(BusinessRule rule) {
53: return ((AddCheckRule) rule).processAddCheckBusinessRules(
54: (AccountingDocument) getDocument(), getCheck());
55: }
56: }
|