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.purap.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.purap.bo.PurApItem;
22: import org.kuali.module.purap.rule.AddPurchasingAccountsPayableItemRule;
23:
24: /**
25: * Add Purchasing Accounts Payble Item Event.
26: * This is triggered when a user presses the add button for a given document's item line.
27: */
28: public final class AddPurchasingAccountsPayableItemEvent extends
29: PurchasingAccountsPayableItemEventBase {
30: /**
31: * Constructs an AddItemEvent with the given errorPathPrefix, document, and item.
32: *
33: * @param errorPathPrefix the error path
34: * @param document document the event was invoked on
35: * @param item the item being added
36: */
37: public AddPurchasingAccountsPayableItemEvent(
38: String errorPathPrefix, Document document, PurApItem item) {
39: super ("adding item to document " + getDocumentId(document),
40: errorPathPrefix, document, item);
41: }
42:
43: /**
44: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
45: */
46: public Class getRuleInterfaceClass() {
47: return AddPurchasingAccountsPayableItemRule.class;
48: }
49:
50: /**
51: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
52: */
53: public boolean invokeRuleMethod(BusinessRule rule) {
54: return ((AddPurchasingAccountsPayableItemRule) rule)
55: .processAddItemBusinessRules(
56: (AccountingDocument) getDocument(), getItem());
57: }
58: }
|