Package org.rossonet.ext.rules.mvel
Class MVELRule
- java.lang.Object
-
- org.rossonet.ext.rules.core.BasicRule
-
- org.rossonet.ext.rules.mvel.MVELRule
-
-
Field Summary
-
Fields inherited from class org.rossonet.ext.rules.core.BasicRule
description, name, priority
-
Fields inherited from interface org.rossonet.ext.rules.api.Rule
DEFAULT_DESCRIPTION, DEFAULT_NAME, DEFAULT_PRIORITY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MVELRuledescription(java.lang.String description)Set rule description.booleanevaluate(Facts facts)This method implements the rule's condition(s).voidexecute(Facts facts)This method implements the rule's action(s).MVELRulename(java.lang.String name)Set rule name.MVELRulepriority(int priority)Set rule priority.MVELRulethen(java.lang.String action)Add an action specified as an MVEL expression to the rule.MVELRulewhen(java.lang.String condition)Specify the rule's condition as MVEL expression.-
Methods inherited from class org.rossonet.ext.rules.core.BasicRule
compareTo, equals, getDescription, getName, getPriority, hashCode, setDescription, setPriority, toString
-
-
-
-
Method Detail
-
description
public MVELRule description(java.lang.String description)
Set rule description.- Parameters:
description- of the rule- Returns:
- this rule
-
evaluate
public boolean evaluate(Facts facts)
Description copied from class:BasicRuleThis method implements the rule's condition(s). Implementations should handle any runtime exception and return true/false accordingly
-
execute
public void execute(Facts facts) throws java.lang.Exception
Description copied from class:BasicRuleThis method implements the rule's action(s).
-
name
public MVELRule name(java.lang.String name)
Set rule name.- Parameters:
name- of the rule- Returns:
- this rule
-
priority
public MVELRule priority(int priority)
Set rule priority.- Parameters:
priority- of the rule- Returns:
- this rule
-
then
public MVELRule then(java.lang.String action)
Add an action specified as an MVEL expression to the rule.- Parameters:
action- to add to the rule- Returns:
- this rule
-
when
public MVELRule when(java.lang.String condition)
Specify the rule's condition as MVEL expression.- Parameters:
condition- of the rule- Returns:
- this rule
-
-