Class BasicRule
java.lang.Object
org.kuali.rice.krms.framework.engine.BasicRule
- All Implemented Interfaces:
Rule
- Direct Known Subclasses:
FalseTriggeredRule
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
ConstructorsConstructorDescriptionBasicRule(String name, Proposition proposition, List<Action> actions) ConstructorBasicRule(Proposition proposition, List<Action> actions) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate(org.kuali.rice.krms.api.engine.ExecutionEnvironment environment) Evaluate a givenExecutionEnvironment, returning true if the rules conditions pass, false if they do not.getName()Return the Rule nameprotected booleanshouldExecuteAction(boolean ruleExecutionResult) Based on the ruleExecutionResult should theActionbe executed?toString()
-
Constructor Details
-
BasicRule
Constructor- Parameters:
name- Rule name to set the name toproposition-Propositionto set the proposition to, cannot be nullactions- Rule Actions to set the actions to- Throws:
IllegalArgumentException- if thePropositionis null
-
BasicRule
Constructor- Parameters:
proposition-Propositionto set the proposition to, cannot be nullactions- Rule Actions to set the actions to- Throws:
IllegalArgumentException- if thePropositionis null
-
-
Method Details
-
evaluate
public boolean evaluate(org.kuali.rice.krms.api.engine.ExecutionEnvironment environment) Description copied from interface:RuleEvaluate a givenExecutionEnvironment, returning true if the rules conditions pass, false if they do not. -
shouldExecuteAction
protected boolean shouldExecuteAction(boolean ruleExecutionResult) Based on the ruleExecutionResult should theActionbe executed? Default behavior is to return the given ruleExecutionResult. Over-writable by subclasses.- Parameters:
ruleExecutionResult- the result of the engines evaluation method.- Returns:
- boolean should the action execute
-
getName
Return the Rule name- Returns:
- name Rule name
-
toString
-