public class BasicRule extends Object implements Rule
| Constructor and Description |
|---|
BasicRule(Proposition proposition,
List<Action> actions)
Constructor
|
BasicRule(String name,
Proposition proposition,
List<Action> actions)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
evaluate(ExecutionEnvironment environment)
Evaluate a given
ExecutionEnvironment, returning true if the rules conditions pass, false if they do not. |
String |
getName()
Return the Rule name
|
protected boolean |
shouldExecuteAction(boolean ruleExecutionResult)
Based on the ruleExecutionResult should the
Action be executed? Default behavior is to return the given ruleExecutionResult. |
String |
toString() |
public BasicRule(String name, Proposition proposition, List<Action> actions)
name - Rule name to set the name toproposition - Proposition to set the proposition to, cannot be nullactions - Rule Actions to set the actions toIllegalArgumentException - if the Proposition is nullpublic BasicRule(Proposition proposition, List<Action> actions)
proposition - Proposition to set the proposition to, cannot be nullactions - Rule Actions to set the actions toIllegalArgumentException - if the Proposition is nullpublic boolean evaluate(ExecutionEnvironment environment)
RuleExecutionEnvironment, returning true if the rules conditions pass, false if they do not.evaluate in interface Ruleenvironment - ExecutionEnvironmentExecutionEnvironment the rule's conditions pass, false if they do notprotected boolean shouldExecuteAction(boolean ruleExecutionResult)
Action be executed? Default behavior is to return the given ruleExecutionResult.
Over-writable by subclasses.ruleExecutionResult - the result of the engines evaluation method.Copyright © 2005–2015 The Kuali Foundation. All rights reserved.