001/** 002 * Copyright 2005-2016 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 */ 016package org.kuali.rice.krad.rules.rule.event; 017 018import org.kuali.rice.krad.document.Document; 019import org.kuali.rice.krad.rules.rule.BusinessRule; 020 021import java.util.List; 022 023/** 024 * Parent interface of all document-related events, which are used to drive the business rules evaluation process. 025 * 026 * 027 */ 028public interface KualiDocumentEvent { 029 /** 030 * @return Document The document associated with this event 031 */ 032 public Document getDocument(); 033 034 /** 035 * The name of the event. 036 * 037 * @return String 038 */ 039 public String getName(); 040 041 /** 042 * A description of the event. 043 * 044 * @return String 045 */ 046 public String getDescription(); 047 048 049 /** 050 * @return errorPathPrefix for this event 051 */ 052 public String getErrorPathPrefix(); 053 054 /** 055 * Returns the interface that classes must implement to receive this event. 056 * 057 * @return 058 */ 059 public Class<? extends BusinessRule> getRuleInterfaceClass(); 060 061 /** 062 * Validates the event has all the necessary properties. 063 */ 064 public void validate(); 065 066 /** 067 * Invokes the event handling method on the rule object. 068 * 069 * @param rule 070 * @return 071 */ 072 public boolean invokeRuleMethod(BusinessRule rule); 073 074 /** 075 * This will return a list of events that are spawned from this event. 076 * 077 * @return 078 */ 079 public List<KualiDocumentEvent> generateEvents(); 080}