public class DefaultDroolsRuleActionContext extends java.lang.Object implements RuleActionContext
RuleActionContext for the drools rule engine.| Constructor and Description |
|---|
DefaultDroolsRuleActionContext(java.util.Map<java.lang.String,java.lang.Object> variables,
java.lang.Object helper) |
| Modifier and Type | Method and Description |
|---|---|
protected KnowledgeHelper |
checkAndGetRuleContext(java.lang.Object ruleContext) |
protected <T> java.util.Set<T> |
evaluateValues(java.lang.Class<T> type,
java.util.List<T> values,
java.lang.String... path) |
protected <T> java.util.Set<T> |
evaluateValues(java.lang.Class<T> type,
java.util.Set<T> values,
java.lang.String... path) |
protected <T> java.util.Set<T> |
findValues(java.lang.Class<T> type,
java.lang.String... path) |
CartRAO |
getCartRao()
Get cart RAO
|
java.lang.Object |
getDelegate()
Returns a rule engine specific context object.
|
java.lang.String |
getMetaData(java.lang.String key)
Returns the rule's meta-data for the given key (or
null). |
java.lang.Object |
getParameter(java.lang.String parameterName)
Returns parameter of the running rule by it name or null if not found.
|
<T> T |
getParameter(java.lang.String parameterName,
java.lang.Class<T> type)
Returns parameter of the running rule by it name and type or throws
IllegalArgumentException otherwise. |
java.util.Map<java.lang.String,java.lang.Object> |
getParameters()
Returns parameters of the running rule.
|
RuleEngineResultRAO |
getRuleEngineResultRao()
Get rule engine result RAO
|
java.util.Map<java.lang.String,java.lang.Object> |
getRuleMetadata()
get rule metadata
|
java.lang.String |
getRuleName()
Get the name of the rule
|
java.util.Optional<java.lang.String> |
getRulesModuleName()
Get the name of the rules module.
|
<T> T |
getValue(java.lang.Class<T> type)
Returns the value for a specific type from the default variables container.
|
<T> T |
getValue(java.lang.Class<T> type,
java.lang.String... path)
Returns the value for a specific type and variables container.
|
<T> java.util.Set<T> |
getValues(java.lang.Class<T> type)
Returns the values for a specific type from the default variables container.
|
<T> java.util.Set<T> |
getValues(java.lang.Class<T> type,
java.lang.String... path)
Returns the values for a specific type and variables container.
|
java.util.Map<java.lang.String,java.lang.Object> |
getVariables() |
void |
halt()
Stops evaluation of following rules
|
void |
insertFacts(java.util.Collection facts)
Insert the facts in a collection to a context
|
void |
insertFacts(java.lang.Object... facts)
Insert the facts in an array to a context
|
boolean |
isStackable()
Deprecated.
since 6.7
|
void |
scheduleForUpdate(java.lang.Object... facts)
schedules the given facts for an update.
|
void |
setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
Sets parameters to the running rule
|
void |
updateFacts(java.lang.Object... facts)
Update the facts in a context
|
void |
updateScheduledFacts()
updates any previously scheduled facts (see
RuleActionContext.scheduleForUpdate(Object...) |
public DefaultDroolsRuleActionContext(java.util.Map<java.lang.String,java.lang.Object> variables,
java.lang.Object helper)
public java.util.Map<java.lang.String,java.lang.Object> getVariables()
public java.lang.Object getDelegate()
RuleActionContextgetDelegate in interface RuleActionContextpublic java.lang.String getMetaData(java.lang.String key)
RuleActionContextnull). Calls toString() on the meta-data
object.getMetaData in interface RuleActionContextpublic <T> T getValue(java.lang.Class<T> type)
RuleActionContextgetValue in interface RuleActionContexttype - - the typepublic void scheduleForUpdate(java.lang.Object... facts)
RuleActionContextRuleActionContext.updateScheduledFacts()scheduleForUpdate in interface RuleActionContextfacts - the facts to schedule for updatepublic <T> java.util.Set<T> getValues(java.lang.Class<T> type)
RuleActionContextgetValues in interface RuleActionContexttype - - the typepublic <T> T getValue(java.lang.Class<T> type,
java.lang.String... path)
RuleActionContextgetValue in interface RuleActionContexttype - - the typepath - - the path for the variables containerpublic <T> java.util.Set<T> getValues(java.lang.Class<T> type,
java.lang.String... path)
RuleActionContextgetValues in interface RuleActionContexttype - - the typepath - - the path for the variables containerpublic void insertFacts(java.lang.Object... facts)
RuleActionContextinsertFacts in interface RuleActionContextfacts - - the array of factspublic void updateScheduledFacts()
RuleActionContextRuleActionContext.scheduleForUpdate(Object...)updateScheduledFacts in interface RuleActionContextpublic void updateFacts(java.lang.Object... facts)
RuleActionContextupdateFacts in interface RuleActionContextfacts - - the array of factspublic void insertFacts(java.util.Collection facts)
RuleActionContextinsertFacts in interface RuleActionContextfacts - - the collection of factsprotected <T> java.util.Set<T> findValues(java.lang.Class<T> type,
java.lang.String... path)
protected <T> java.util.Set<T> evaluateValues(java.lang.Class<T> type,
java.util.List<T> values,
java.lang.String... path)
protected <T> java.util.Set<T> evaluateValues(java.lang.Class<T> type,
java.util.Set<T> values,
java.lang.String... path)
public CartRAO getCartRao()
RuleActionContextgetCartRao in interface RuleActionContextpublic RuleEngineResultRAO getRuleEngineResultRao()
RuleActionContextgetRuleEngineResultRao in interface RuleActionContextpublic java.lang.String getRuleName()
RuleActionContextgetRuleName in interface RuleActionContextpublic java.util.Optional<java.lang.String> getRulesModuleName()
RuleActionContextgetRulesModuleName in interface RuleActionContextpublic java.util.Map<java.lang.String,java.lang.Object> getRuleMetadata()
RuleActionContextgetRuleMetadata in interface RuleActionContextprotected KnowledgeHelper checkAndGetRuleContext(java.lang.Object ruleContext)
public java.util.Map<java.lang.String,java.lang.Object> getParameters()
RuleActionContextgetParameters in interface RuleActionContextpublic java.lang.Object getParameter(java.lang.String parameterName)
RuleActionContextgetParameter in interface RuleActionContextpublic <T> T getParameter(java.lang.String parameterName,
java.lang.Class<T> type)
RuleActionContextIllegalArgumentException otherwise.getParameter in interface RuleActionContextpublic void setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
RuleActionContextsetParameters in interface RuleActionContextparameters - - map of named objects, creating the execution context for an action@Deprecated public boolean isStackable()
RuleActionContextisStackable in interface RuleActionContextpublic void halt()
RuleActionContexthalt in interface RuleActionContextCopyright © 2018 SAP SE. All Rights Reserved.