org.kuali.rice.krms.framework.engine
Class BasicRule

java.lang.Object
  extended by org.kuali.rice.krms.framework.engine.BasicRule
All Implemented Interfaces:
Rule
Direct Known Subclasses:
FalseTriggeredRule, ValidationRule

public class BasicRule
extends Object
implements Rule

A Rule that executes a Action when the Proposition is true.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
BasicRule(Proposition proposition, List<Action> actions)
           
BasicRule(String name, Proposition proposition, List<Action> actions)
           
 
Method Summary
 boolean evaluate(ExecutionEnvironment environment)
           
 String getName()
           
protected  boolean shouldExecuteAction(boolean ruleExecutionResult)
          overridden
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicRule

public BasicRule(String name,
                 Proposition proposition,
                 List<Action> actions)
Parameters:
name - Rule name
proposition - cannot be null
actions - Rule Actions
Throws:
IllegalArgumentException - if the Proposition is null

BasicRule

public BasicRule(Proposition proposition,
                 List<Action> actions)
Parameters:
proposition - cannot be null
actions - Rule Actions
Throws:
IllegalArgumentException - if the Proposition is null
Method Detail

evaluate

public boolean evaluate(ExecutionEnvironment environment)
Specified by:
evaluate in interface Rule
Parameters:
environment - ExecutionEnvironment
Returns:
true if given ExecutionEnvironment the rule's conditions pass, false if they do not

shouldExecuteAction

protected boolean shouldExecuteAction(boolean ruleExecutionResult)
overridden

Parameters:
ruleExecutionResult - the result of the engines evaluation method.
Returns:
should the action execute

getName

public String getName()
Returns:
name Rule name

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.