001    /**
002     * Copyright 2005-2012 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.framework.engine;
017    
018    import java.util.List;
019    
020    import org.kuali.rice.krms.api.engine.Engine;
021    import org.kuali.rice.krms.api.engine.ExecutionEnvironment;
022    
023    /**
024     * Interface for logical propositions that may be executed in the {@link Engine}.
025     * @see PropositionResult
026     * @author Kuali Rice Team (rice.collab@kuali.org)
027     */
028    public interface Proposition {
029    
030        /**
031         * Evaluates this proposition -- and in the case of {@link Proposition}s containing children,
032         * those children as well -- and returns the boolean result; 
033         * 
034         * @param environment the {@link ExecutionEnvironment} that this {@link Proposition} is running in
035         * @return the boolean result of evaluation
036         */
037            public PropositionResult evaluate(ExecutionEnvironment environment);
038            
039            /**
040             * Returns the {@link List} of child {@link Proposition}s that belong to this object.
041             * If there are no children (e.g. for simple {@link Proposition} types), this must
042             * return an empty {@link List}.
043             * 
044             * @return a {@link List} containing any child {@link Proposition}s that belong to this object.  Must never return null.
045             */
046            public List<Proposition> getChildren();
047            
048            /**
049             * Indicates whether this {@link Proposition} can have children.
050             * @return true if this {@link Proposition} can contain child {@link Proposition}s.
051             */
052            public boolean isCompound();
053                    
054    }