001 /*
002 * Copyright 2011 The Kuali Foundation.
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.kfs.module.endow.document.validation.event;
017
018 import org.kuali.kfs.module.endow.businessobject.EndowmentTransactionLine;
019 import org.kuali.kfs.module.endow.businessobject.EndowmentTransactionTaxLotLine;
020 import org.kuali.kfs.module.endow.document.EndowmentTaxLotLinesDocument;
021 import org.kuali.kfs.module.endow.document.validation.DeleteTaxLotLineRule;
022 import org.kuali.rice.kns.rule.BusinessRule;
023 import org.kuali.rice.kns.rule.event.KualiDocumentEventBase;
024
025 public class DeleteTaxLotLineEvent extends KualiDocumentEventBase {
026 private EndowmentTransactionLine transactionLine;
027 private int transLineIndex;
028 private EndowmentTransactionTaxLotLine taxLotLine;
029 private int taxLotLineIndex;
030
031 public DeleteTaxLotLineEvent(String errorPathPrefix, EndowmentTaxLotLinesDocument document, EndowmentTransactionTaxLotLine taxLotLine, EndowmentTransactionLine transactionLine, int index, int taxLotLineIndex) {
032 super("Deleting Tax Lot Line from document " + getDocumentId(document), errorPathPrefix, document);
033 this.document = document;
034 this.transactionLine = transactionLine;
035 this.transLineIndex = index;
036 this.taxLotLine = taxLotLine;
037 this.taxLotLineIndex = taxLotLineIndex;
038 }
039
040 /**
041 * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
042 */
043 @SuppressWarnings("unchecked")
044 public Class getRuleInterfaceClass() {
045 return DeleteTaxLotLineRule.class;
046 }
047
048 /**
049 * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.kns.rule.BusinessRule)
050 */
051 public boolean invokeRuleMethod(BusinessRule rule) {
052 return ((DeleteTaxLotLineRule<EndowmentTaxLotLinesDocument, EndowmentTransactionTaxLotLine, EndowmentTransactionLine, Number, Number>) rule).processDeleteTaxLotLineRules((EndowmentTaxLotLinesDocument) document, taxLotLine, transactionLine, transLineIndex, taxLotLineIndex);
053 }
054
055 }