Class DefaultDroolsRuleActionContext
java.lang.Object
de.hybris.platform.droolsruleengineservices.compiler.impl.DefaultDroolsRuleActionContext
- All Implemented Interfaces:
RuleActionContext
Default implementation of
RuleActionContext for the drools rule engine.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.drools.core.spi.KnowledgeHelpercheckAndGetRuleContext(Object ruleContext) protected <T> Set<T>evaluateValues(Class<T> type, List<T> values, String... path) protected <T> Set<T>evaluateValues(Class<T> type, Set<T> values, String... path) protected <T> Set<T>findValues(Class<T> type, String... path) Get cart RAOReturns a rule engine specific context object.getMetaData(String key) Returns the rule's meta-data for the given key (ornull).getParameter(String parameterName) Returns parameter of the running rule by it name or null if not found.<T> TgetParameter(String parameterName, Class<T> type) Returns parameter of the running rule by it name and type or throwsIllegalArgumentExceptionotherwise.Returns parameters of the running rule.Get rule engine result RAOget rule metadataGet the name of the ruleGet the name of the rules module.<T> TReturns the value for a specific type from the default variables container.<T> TReturns the value for a specific type and variables container.<T> Set<T>Returns the values for a specific type from the default variables container.<T> Set<T>Returns the values for a specific type and variables container.voidhalt()Stops evaluation of following rulesvoidinsertFacts(Object... facts) Insert the facts in an array to a contextvoidinsertFacts(Collection facts) Insert the facts in a collection to a contextvoidscheduleForUpdate(Object... facts) schedules the given facts for an update.voidsetParameters(Map<String, Object> parameters) Sets parameters to the running rulevoidupdateFacts(Object... facts) Update the facts in a contextvoidupdates any previously scheduled facts (seeRuleActionContext.scheduleForUpdate(Object...)
-
Constructor Details
-
DefaultDroolsRuleActionContext
-
-
Method Details
-
getVariables
-
getDelegate
Description copied from interface:RuleActionContextReturns a rule engine specific context object.- Specified by:
getDelegatein interfaceRuleActionContext
-
getMetaData
Description copied from interface:RuleActionContextReturns the rule's meta-data for the given key (ornull). CallstoString()on the meta-data object.- Specified by:
getMetaDatain interfaceRuleActionContext- Returns:
- the string representation of the meta-data (or null)
-
getValue
Description copied from interface:RuleActionContextReturns the value for a specific type from the default variables container. If more than one value is found, the first one is returned.- Specified by:
getValuein interfaceRuleActionContext- Parameters:
type- - the type- Returns:
- the value or null if no value is found for the given type
-
scheduleForUpdate
Description copied from interface:RuleActionContextschedules the given facts for an update. Note: The actual fact update is invoked viaRuleActionContext.updateScheduledFacts()- Specified by:
scheduleForUpdatein interfaceRuleActionContext- Parameters:
facts- the facts to schedule for update
-
getValues
Description copied from interface:RuleActionContextReturns the values for a specific type from the default variables container.- Specified by:
getValuesin interfaceRuleActionContext- Parameters:
type- - the type- Returns:
- the values or an empty set if no value is found for the given type
-
getValue
Description copied from interface:RuleActionContextReturns the value for a specific type and variables container. If more than one value is found, the first one is returned.- Specified by:
getValuein interfaceRuleActionContext- Parameters:
type- - the typepath- - the path for the variables container- Returns:
- the value or null if no value is found for the given type
-
getValues
Description copied from interface:RuleActionContextReturns the values for a specific type and variables container.- Specified by:
getValuesin interfaceRuleActionContext- Parameters:
type- - the typepath- - the path for the variables container- Returns:
- the values or an empty set if no value is found for the given type
-
insertFacts
Description copied from interface:RuleActionContextInsert the facts in an array to a context- Specified by:
insertFactsin interfaceRuleActionContext- Parameters:
facts- - the array of facts
-
updateScheduledFacts
public void updateScheduledFacts()Description copied from interface:RuleActionContextupdates any previously scheduled facts (seeRuleActionContext.scheduleForUpdate(Object...)- Specified by:
updateScheduledFactsin interfaceRuleActionContext
-
updateFacts
Description copied from interface:RuleActionContextUpdate the facts in a context- Specified by:
updateFactsin interfaceRuleActionContext- Parameters:
facts- - the array of facts
-
insertFacts
Description copied from interface:RuleActionContextInsert the facts in a collection to a context- Specified by:
insertFactsin interfaceRuleActionContext- Parameters:
facts- - the collection of facts
-
findValues
-
evaluateValues
-
evaluateValues
-
getCartRao
Description copied from interface:RuleActionContextGet cart RAO- Specified by:
getCartRaoin interfaceRuleActionContext
-
getRuleEngineResultRao
Description copied from interface:RuleActionContextGet rule engine result RAO- Specified by:
getRuleEngineResultRaoin interfaceRuleActionContext
-
getRuleName
Description copied from interface:RuleActionContextGet the name of the rule- Specified by:
getRuleNamein interfaceRuleActionContext
-
getRulesModuleName
Description copied from interface:RuleActionContextGet the name of the rules module.- Specified by:
getRulesModuleNamein interfaceRuleActionContext
-
getRuleMetadata
Description copied from interface:RuleActionContextget rule metadata- Specified by:
getRuleMetadatain interfaceRuleActionContext
-
checkAndGetRuleContext
-
getParameters
Description copied from interface:RuleActionContextReturns parameters of the running rule.- Specified by:
getParametersin interfaceRuleActionContext
-
getParameter
Description copied from interface:RuleActionContextReturns parameter of the running rule by it name or null if not found.- Specified by:
getParameterin interfaceRuleActionContext
-
getParameter
Description copied from interface:RuleActionContextReturns parameter of the running rule by it name and type or throwsIllegalArgumentExceptionotherwise.- Specified by:
getParameterin interfaceRuleActionContext
-
setParameters
Description copied from interface:RuleActionContextSets parameters to the running rule- Specified by:
setParametersin interfaceRuleActionContext- Parameters:
parameters- - map of named objects, creating the execution context for an action
-
halt
public void halt()Description copied from interface:RuleActionContextStops evaluation of following rules- Specified by:
haltin interfaceRuleActionContext
-