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