1 /** 2 * Copyright 2005-2016 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 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.rice.krms.api.repository.context; 17 18 import org.kuali.rice.core.api.mo.common.Identifiable; 19 import org.kuali.rice.core.api.mo.common.Versioned; 20 import org.kuali.rice.core.api.mo.common.active.Inactivatable; 21 import org.kuali.rice.krms.api.repository.agenda.AgendaDefinitionContract; 22 23 import java.rmi.activation.Activatable; 24 import java.util.List; 25 import java.util.Map; 26 27 /** 28 * An interface which defines the contract for context definition objects. 29 * <p>A context is a set of related krms entities. A context definition 30 * defines information about a context which can be loaded into the rules 31 * engine for evaluation. 32 * 33 * A context definition includes a list of agendas which are valid within the 34 * context. Typically, during rule engine execution, one or more of these 35 * agendas is selected for execution based on a given set of selection criteria. All KRMS components 36 * (agendas, rules, actions, terms, etc.) must be of the same context to 37 * work together. It is up to the client implementor to choose how broadly or 38 * finely grained the scope of the context is to be. 39 * </p> 40 * 41 * @author Kuali Rice Team (rice.collab@kuali.org) 42 * 43 */ 44 public interface ContextDefinitionContract extends Versioned, Identifiable, Inactivatable { 45 46 /** 47 * Returns the namespace of the context definition. The combination of 48 * namespace and name represent a unique business key for the context 49 * definition. The namespace should never be null or blank. 50 * 51 * @return the namespace of the context definition, should never be null or blank 52 */ 53 String getNamespace(); 54 55 /** 56 * Returns the name of the context definition. The combination of name and namespaceCode 57 * represent a unique business key for the context definition. The name should never be 58 * null or blank. 59 * 60 * @return the name of the context definition, should never be null or blank 61 */ 62 String getName(); 63 64 /** 65 * Returns the type id for the context definition. If the type id is null, that means 66 * this context definition is of the default type. 67 * 68 * @return the type id for the context definition, or null if this context definition is of the default type 69 */ 70 String getTypeId(); 71 72 73 /** 74 * Returns the description of the context definition. 75 * 76 * @return the description of the context definition. May be null. 77 */ 78 String getDescription(); 79 80 /** 81 * Returns the list of agendas {@link AgendaDefinitionContract} contained in the context definition. 82 * This method should never return null. An empty list is returned 83 * if no agendas are associated with this context. 84 * 85 * @return the list of agendas contained in this context definition 86 */ 87 List<? extends AgendaDefinitionContract> getAgendas(); 88 89 /** 90 * Returns a map of name/value pairs representing the 91 * attributes associated with this context. 92 * <p>This method should never 93 * return null. An empty map is returned if no attributes are associated 94 * with the context.</p> 95 * 96 * @return a list of Map of name/value String pairs. 97 */ 98 public Map<String, String> getAttributes(); 99 100 }