001    /**
002     * Copyright 2005-2013 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.rice.krms.api.repository.context;
017    
018    import org.kuali.rice.core.api.mo.common.Identifiable;
019    import org.kuali.rice.core.api.mo.common.Versioned;
020    import org.kuali.rice.core.api.mo.common.active.Inactivatable;
021    import org.kuali.rice.krms.api.repository.agenda.AgendaDefinitionContract;
022    
023    import java.rmi.activation.Activatable;
024    import java.util.List;
025    import java.util.Map;
026    
027    /**
028     * An interface which defines the contract for context definition objects.
029     * <p>A context is a set of related krms entities. A context definition
030     * defines information about a context which can be loaded into the rules
031     * engine for evaluation.
032     *
033     * A context definition includes a list of agendas which are valid within the
034     * context.  Typically, during rule engine execution, one or more of these
035     * agendas is selected for execution based on a given set of selection criteria. All KRMS components
036     * (agendas, rules, actions, terms, etc.) must be of the same context to
037     * work together. It is up to the client implementor to choose how broadly or
038     * finely grained the scope of the context is to be.
039     * </p>
040     * 
041     * @author Kuali Rice Team (rice.collab@kuali.org)
042     * 
043     */
044    public interface ContextDefinitionContract extends Versioned, Identifiable, Inactivatable {
045    
046            /**
047             * Returns the namespace of the context definition.  The combination of
048             * namespace and name represent a unique business key for the context
049             * definition.  The namespace should never be null or blank.
050             * 
051             * @return the namespace of the context definition, should never be null or blank
052             */
053            String getNamespace();
054            
055            /**
056             * Returns the name of the context definition.  The combination of name and namespaceCode
057             * represent a unique business key for the context definition.  The name should never be
058             * null or blank.
059             * 
060             * @return the name of the context definition, should never be null or blank
061             */
062            String getName();
063            
064            /**
065             * Returns the type id for the context definition.  If the type id is null, that means
066             * this context definition is of the default type.
067             * 
068             * @return the type id for the context definition, or null if this context definition is of the default type
069             */
070            String getTypeId();
071            
072            
073        /**
074         * Returns the description of the context definition.
075         *
076         * @return the description of the context definition. May be null.
077         */
078        String getDescription();
079    
080            /**
081             * Returns the list of agendas {@link AgendaDefinitionContract} contained in the context definition.
082             * This method should never return null. An empty list is returned
083         * if no agendas are associated with this context.
084             * 
085             * @return the list of agendas contained in this context definition
086             */
087            List<? extends AgendaDefinitionContract> getAgendas();
088    
089            /**
090             * Returns a map of name/value pairs representing the
091         * attributes associated with this context.
092         * <p>This method should never
093         * return null. An empty map is returned if no attributes are associated
094         * with the context.</p>
095             * 
096             * @return a list of Map of name/value String pairs.
097             */
098            public Map<String, String> getAttributes();
099            
100    }