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.krms.api.repository.proposition;
017
018import java.util.List;
019
020import org.kuali.rice.core.api.mo.common.Identifiable;
021import org.kuali.rice.core.api.mo.common.Versioned;
022
023/**
024 * Defines the contract for a {@link PropositionDefinition}
025 *
026 * @see PropositionDefinition
027 *
028 * @author Kuali Rice Team (rice.collab@kuali.org)
029 */
030public interface PropositionDefinitionContract extends Identifiable, Versioned {
031        /**
032         * Returns the description text for the KRMS proposition
033         * @return description for KRMS type.
034         */
035        public String getDescription();
036
037        /**
038         * Returns the id of Proposition KrmsType of the proposition.
039         * It provides some context to what type of object of the KRMS type.
040         * @return the id of the KRMS type.
041         */
042        public String getTypeId();
043        
044        /**
045         * TReturns the ID of the rule this proposition belongs to.  May be null if this proposition has
046         * not yet been persisted.
047         * 
048         * @return the ID of the Rule this proposition belongs to.
049         */
050        public String getRuleId();
051
052        /**
053         * <p>
054         * There are three main types of Propositions:
055         *   Compound Propositions - a proposition consisting of other propositions 
056         *      and a boolean algebra operator (AND, OR) defining how to evaluate 
057         *      those propositions.
058     *   Parameterized Propositions - a proposition which is parameterized by 
059     *      some set of values, evaluation logic is implemented by hand and 
060     *      returns true or false
061     *   Simple Propositions - a proposition of the form lhs op rhs where 
062     *          lhs=left-hand side, rhs=right-hand side, and op=operator
063         * </p>
064         * @return the proposition type code of the proposition
065         * <p>
066         *      Valid values are C = compound, P = parameterized, S = simple
067         * </p>
068         */
069        public String getPropositionTypeCode();
070        
071        /**
072         * Returns the parameter list of the proposition.
073         * Parameters are listed in Reverse Polish Notation.
074         * Parameters may be constants, terms, or functions.
075         * <p>
076         * Compound Propositions will have an empty parameter list.
077         * </p>
078         * @see PropositionParameter
079         * @return the Parameters related to the proposition
080         */
081        public List<? extends PropositionParameterContract> getParameters();
082        
083        /**
084         * Returns the op code to be used when evaluating compound
085         * propositions. 
086         * 
087         * @return the compound op code. 
088         *    valid values are A = and, O = or
089         */
090        public String getCompoundOpCode();
091        
092       /**
093         * Returns the sequence number used to order the 
094         * compound propositions
095         * 
096         * Note: this value is set by the service 
097         * 
098         * 
099         * @return the compound sequence number 
100         */
101        public Integer getCompoundSequenceNumber();
102
103        /**
104         * 
105         * Returns the propositions which are contained in a
106         * compound proposition.
107         * 
108         * @return an ordered list of the Propositions which make up the compound
109         * proposition.
110         */
111        public List<? extends PropositionDefinitionContract> getCompoundComponents();
112}