1 /** 2 * Copyright 2005-2014 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.proposition; 17 18 import java.util.List; 19 20 import org.kuali.rice.core.api.mo.common.Identifiable; 21 import org.kuali.rice.core.api.mo.common.Versioned; 22 23 /** 24 * Defines the contract for a {@link PropositionDefinition} 25 * 26 * @see PropositionDefinition 27 * 28 * @author Kuali Rice Team (rice.collab@kuali.org) 29 */ 30 public interface PropositionDefinitionContract extends Identifiable, Versioned { 31 /** 32 * Returns the description text for the KRMS proposition 33 * @return description for KRMS type. 34 */ 35 public String getDescription(); 36 37 /** 38 * Returns the id of Proposition KrmsType of the proposition. 39 * It provides some context to what type of object of the KRMS type. 40 * @return the id of the KRMS type. 41 */ 42 public String getTypeId(); 43 44 /** 45 * TReturns the ID of the rule this proposition belongs to. May be null if this proposition has 46 * not yet been persisted. 47 * 48 * @return the ID of the Rule this proposition belongs to. 49 */ 50 public String getRuleId(); 51 52 /** 53 * <p> 54 * There are three main types of Propositions: 55 * Compound Propositions - a proposition consisting of other propositions 56 * and a boolean algebra operator (AND, OR) defining how to evaluate 57 * those propositions. 58 * Parameterized Propositions - a proposition which is parameterized by 59 * some set of values, evaluation logic is implemented by hand and 60 * returns true or false 61 * Simple Propositions - a proposition of the form lhs op rhs where 62 * lhs=left-hand side, rhs=right-hand side, and op=operator 63 * </p> 64 * @return the proposition type code of the proposition 65 * <p> 66 * Valid values are C = compound, P = parameterized, S = simple 67 * </p> 68 */ 69 public String getPropositionTypeCode(); 70 71 /** 72 * Returns the parameter list of the proposition. 73 * Parameters are listed in Reverse Polish Notation. 74 * Parameters may be constants, terms, or functions. 75 * <p> 76 * Compound Propositions will have an empty parameter list. 77 * </p> 78 * @see PropositionParameter 79 * @return the Parameters related to the proposition 80 */ 81 public List<? extends PropositionParameterContract> getParameters(); 82 83 /** 84 * Returns the op code to be used when evaluating compound 85 * propositions. 86 * 87 * @return the compound op code. 88 * valid values are A = and, O = or 89 */ 90 public String getCompoundOpCode(); 91 92 /** 93 * Returns the sequence number used to order the 94 * compound propositions 95 * 96 * Note: this value is set by the service 97 * 98 * 99 * @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 }