001/* 002 * Copyright 2013 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 1.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/ecl1.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 */ 016package org.kuali.ole.select.document.validation.event; 017 018import org.kuali.ole.select.businessobject.OleCreditMemoItem; 019import org.kuali.ole.select.document.validation.impl.OleValidationRule; 020import org.kuali.ole.select.document.validation.impl.OleValidationRuleBase; 021import org.kuali.rice.krad.document.Document; 022import org.kuali.rice.krad.rules.rule.BusinessRule; 023import org.kuali.rice.krad.rules.rule.event.KualiDocumentEventBase; 024 025public class OleForeignCurrencyCreditMemoEvent extends KualiDocumentEventBase { 026 027 private OleCreditMemoItem creditMemoItem; 028 029 protected OleForeignCurrencyCreditMemoEvent(String errorPathPrefix, Document document) { 030 super("Creating Note Tag" + getDocumentId(document), errorPathPrefix, document); 031 } 032 033 public OleForeignCurrencyCreditMemoEvent(Document document, OleCreditMemoItem creditMemoItem) { 034 this("", document); 035 this.creditMemoItem = creditMemoItem; 036 } 037 038 public OleCreditMemoItem getCreditMemoItem() { 039 return creditMemoItem; 040 } 041 042 public void setCreditMemoItem(OleCreditMemoItem creditMemoItem) { 043 this.creditMemoItem = creditMemoItem; 044 } 045 046 @Override 047 public Class getRuleInterfaceClass() { 048 return OleValidationRuleBase.class; 049 } 050 051 @Override 052 public boolean invokeRuleMethod(BusinessRule rule) { 053 return ((OleValidationRule) rule).processCustomForeignCurrencyCreditMemoBusinessRules(document, creditMemoItem); 054 } 055 056 057}