Class DefaultRuleCompilerContext
java.lang.Object
de.hybris.platform.ruleengineservices.compiler.impl.DefaultRuleCompilerContext
- All Implemented Interfaces:
RuleCompilerContext
Default implementation of
RuleCompilerContext.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultRuleCompilerContext(RuleCompilationContext ruleCompilationContext, AbstractRuleModel rule, String moduleName, RuleIrVariablesGenerator variablesGenerator) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailureException(Exception exception) voidaddProblem(RuleCompilerProblem problem) Adds a problem arose during compilation process to the list.A shortcut toRuleIrVariablesGenerator.createLocalContainer().generateLocalVariable(RuleIrLocalVariablesContainer container, Class<?> type) generateVariable(Class<?> type) A shortcut toRuleIrVariablesGenerator.generateVariable(Class).Returns action definitions for ruleReturns a mutableMapthat can be used to store attributes associated with thisRuleCompilerContext.Returns condition definitions for ruleReturns all failure causing exceptions for thisRuleCompilerContext.Returns the rules module name.Returns all problems arose during compilation process.getRule()Returns the rule.get Rules compilation context for a given compilationReturns rule conditions for ruleReturns the rule parameters.longReturns the rule version.Returns the variables generator valid for this compiler context.voidsetRuleVersion(long version) Provides means of setting engine version of the rule.
-
Constructor Details
-
DefaultRuleCompilerContext
public DefaultRuleCompilerContext(RuleCompilationContext ruleCompilationContext, AbstractRuleModel rule, String moduleName, RuleIrVariablesGenerator variablesGenerator)
-
-
Method Details
-
getRule
Description copied from interface:RuleCompilerContextReturns the rule.- Specified by:
getRulein interfaceRuleCompilerContext- Returns:
- rule
-
getModuleName
Description copied from interface:RuleCompilerContextReturns the rules module name.- Specified by:
getModuleNamein interfaceRuleCompilerContext- Returns:
- rules module name
-
getRuleParameters
Description copied from interface:RuleCompilerContextReturns the rule parameters.- Specified by:
getRuleParametersin interfaceRuleCompilerContext- Returns:
- The rule parameters
-
getVariablesGenerator
Description copied from interface:RuleCompilerContextReturns the variables generator valid for this compiler context.- Specified by:
getVariablesGeneratorin interfaceRuleCompilerContext- Returns:
- the variables generator
-
generateVariable
Description copied from interface:RuleCompilerContextA shortcut toRuleIrVariablesGenerator.generateVariable(Class).- Specified by:
generateVariablein interfaceRuleCompilerContext- Parameters:
type- - the type- Returns:
- the name of the variable
-
createLocalContainer
Description copied from interface:RuleCompilerContextA shortcut toRuleIrVariablesGenerator.createLocalContainer().- Specified by:
createLocalContainerin interfaceRuleCompilerContext- Returns:
- the current container
-
generateLocalVariable
Description copied from interface:RuleCompilerContext- Specified by:
generateLocalVariablein interfaceRuleCompilerContexttype- - the type- Returns:
- the name of the variable
-
getAttributes
Description copied from interface:RuleCompilerContextReturns a mutableMapthat can be used to store attributes associated with thisRuleCompilerContext.- Specified by:
getAttributesin interfaceRuleCompilerContext- Returns:
- the map containing the attributes
-
addFailureException
-
getFailureExceptions
Description copied from interface:RuleCompilerContextReturns all failure causing exceptions for thisRuleCompilerContext.- Specified by:
getFailureExceptionsin interfaceRuleCompilerContext
-
getProblems
Description copied from interface:RuleCompilerContextReturns all problems arose during compilation process.- Specified by:
getProblemsin interfaceRuleCompilerContext
-
addProblem
Description copied from interface:RuleCompilerContextAdds a problem arose during compilation process to the list.- Specified by:
addProblemin interfaceRuleCompilerContext
-
getConditionDefinitions
Description copied from interface:RuleCompilerContextReturns condition definitions for rule- Specified by:
getConditionDefinitionsin interfaceRuleCompilerContext
-
getActionDefinitions
Description copied from interface:RuleCompilerContextReturns action definitions for rule- Specified by:
getActionDefinitionsin interfaceRuleCompilerContext
-
getRuleConditions
Description copied from interface:RuleCompilerContextReturns rule conditions for rule- Specified by:
getRuleConditionsin interfaceRuleCompilerContext
-
getRuleCompilationContext
Description copied from interface:RuleCompilerContextget Rules compilation context for a given compilation- Specified by:
getRuleCompilationContextin interfaceRuleCompilerContext- Returns:
- instance of
RuleCompilationContext
-
getRuleVersion
public long getRuleVersion()Description copied from interface:RuleCompilerContextReturns the rule version.- Specified by:
getRuleVersionin interfaceRuleCompilerContext- Returns:
- engine rule version
-
setRuleVersion
public void setRuleVersion(long version) Description copied from interface:RuleCompilerContextProvides means of setting engine version of the rule.- Specified by:
setRuleVersionin interfaceRuleCompilerContext- Parameters:
version- - engine rule version
-