Coverage Report - org.kuali.rice.krms.api.engine.ExecutionFlag
 
Classes in this File Line Coverage Branch Coverage Complexity
ExecutionFlag
100%
7/7
N/A
1
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.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/ecl1.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.engine;
 17  
 
 18  
 /**
 19  
  * Defines various possible flags that can be used to control how the rules
 20  
  * engine executes and performs it's evaluation of rules.  These flags are
 21  
  * meant to be set to either true or false.  This is done using the
 22  
  * {@link ExecutionOptions} that are passed to the engine at execution time.
 23  
  * 
 24  
  * @see ExecutionOptions
 25  
  * 
 26  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 27  
  *
 28  
  */
 29  1
 public enum ExecutionFlag {
 30  
 
 31  
         /**
 32  
          * Indicates that the engine should perform default logging by recording
 33  
          * each {@link ResultEvent} in the {@link EngineResults}.  Default value
 34  
          * is false.
 35  
          * 
 36  
          * @see EngineResults
 37  
          */
 38  1
         LOG_EXECUTION(false),
 39  
         
 40  
         /**
 41  
          * Indicates that the selection criteria which is passed to the engine
 42  
          * at the time of execution must be able to select a valid context in
 43  
          * order for engine execution to proceed.  Default value is false,
 44  
          * when false the engine will simply not execute if no valid context
 45  
          * can be located for the specified selection criteria.
 46  
          * 
 47  
          * @see SelectionCriteria
 48  
          */
 49  1
         CONTEXT_MUST_EXIST(false);
 50  
         
 51  
         private final boolean defaultValue;
 52  
         
 53  2
         private ExecutionFlag(boolean defaultValue) {
 54  2
                 this.defaultValue = defaultValue;
 55  2
         }
 56  
         
 57  
         /**
 58  
          * Returns the default value for the flag if it has not been explicitly set.
 59  
          * 
 60  
          * @return the default value for the flag
 61  
          */
 62  
         public boolean getDefaultValue() {
 63  4
                 return this.defaultValue;
 64  
         }
 65  
         
 66  
 }