public abstract class AbstractRuleBookRunner extends Auditor implements RuleBook
| Constructor and Description |
|---|
AbstractRuleBookRunner(java.lang.Class<? extends RuleBook> prototypeClass)
Creates a new RuleBookRunner using the RuleBook class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRule(Rule rule)
Add a Rule.
|
protected abstract java.util.List<java.lang.Class<?>> |
getPojoRules()
Gets the POJO Rules used in the RuleBook.
|
java.util.Optional<Result> |
getResult()
Get the Result of the RuleBook.
|
boolean |
hasRules()
The hasRules() method returns true if any Rules have been defined in the RuleBook.
|
void |
run(NameValueReferableMap facts)
Run the RuleBook given the facts supplied.
|
void |
setDefaultResult(java.lang.Object result)
Set the default Result value; this should be set for RuleBooks that are expected to produce a Result.
|
getRuleStatus, getRuleStatusMap, registerRule, updateRuleStatusclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdefineRulespublic AbstractRuleBookRunner(java.lang.Class<? extends RuleBook> prototypeClass)
prototypeClass - a RuleBook class that determines how the RuleBook is runpublic void run(NameValueReferableMap facts)
RuleBookpublic void setDefaultResult(java.lang.Object result)
RuleBooksetDefaultResult in interface RuleBookresult - the default Result valuepublic java.util.Optional<Result> getResult()
RuleBookpublic boolean hasRules()
RuleBookprotected abstract java.util.List<java.lang.Class<?>> getPojoRules()