Interface RuleCompilerContext
-
- All Known Implementing Classes:
DefaultRuleCompilerContext
public interface RuleCompilerContextThis interface represents the context valid for the compilation of a rule. It is passed to, and potentially modified by, each phase of the compilation process.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddProblem(RuleCompilerProblem problem)Adds a problem arose during compilation process to the list.RuleIrLocalVariablesContainercreateLocalContainer()A shortcut toRuleIrVariablesGenerator.createLocalContainer().java.lang.StringgenerateLocalVariable(RuleIrLocalVariablesContainer container, java.lang.Class<?> type)java.lang.StringgenerateVariable(java.lang.Class<?> type)A shortcut toRuleIrVariablesGenerator.generateVariable(Class).java.util.Map<java.lang.String,RuleActionDefinitionData>getActionDefinitions()Returns action definitions for rulejava.util.Map<java.lang.String,java.lang.Object>getAttributes()Returns a mutableMapthat can be used to store attributes associated with thisRuleCompilerContext.java.util.Map<java.lang.String,RuleConditionDefinitionData>getConditionDefinitions()Returns condition definitions for rulejava.util.List<java.lang.Exception>getFailureExceptions()Returns all failure causing exceptions for thisRuleCompilerContext.java.lang.StringgetModuleName()Returns the rules module name.java.util.List<RuleCompilerProblem>getProblems()Returns all problems arose during compilation process.AbstractRuleModelgetRule()Returns the rule.RuleCompilationContextgetRuleCompilationContext()get Rules compilation context for a given compilationjava.util.List<RuleConditionData>getRuleConditions()Returns rule conditions for rulejava.util.List<RuleParameterData>getRuleParameters()Returns the rule parameters.longgetRuleVersion()Returns the rule version.RuleIrVariablesGeneratorgetVariablesGenerator()Returns the variables generator valid for this compiler context.voidsetRuleVersion(long version)Provides means of setting engine version of the rule.
-
-
-
Method Detail
-
getRule
AbstractRuleModel getRule()
Returns the rule.- Returns:
- rule
-
getRuleVersion
long getRuleVersion()
Returns the rule version.- Returns:
- engine rule version
-
setRuleVersion
void setRuleVersion(long version)
Provides means of setting engine version of the rule.- Parameters:
version- - engine rule version
-
getModuleName
java.lang.String getModuleName()
Returns the rules module name.- Returns:
- rules module name
-
getRuleParameters
java.util.List<RuleParameterData> getRuleParameters()
Returns the rule parameters.- Returns:
- The rule parameters
-
getVariablesGenerator
RuleIrVariablesGenerator getVariablesGenerator()
Returns the variables generator valid for this compiler context.- Returns:
- the variables generator
-
generateVariable
java.lang.String generateVariable(java.lang.Class<?> type)
A shortcut toRuleIrVariablesGenerator.generateVariable(Class).- Parameters:
type- - the type- Returns:
- the name of the variable
-
createLocalContainer
RuleIrLocalVariablesContainer createLocalContainer()
A shortcut toRuleIrVariablesGenerator.createLocalContainer().- Returns:
- the current container
-
generateLocalVariable
java.lang.String generateLocalVariable(RuleIrLocalVariablesContainer container, java.lang.Class<?> type)
- Parameters:
type- - the type- Returns:
- the name of the variable
-
getAttributes
java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns a mutableMapthat can be used to store attributes associated with thisRuleCompilerContext.- Returns:
- the map containing the attributes
-
getFailureExceptions
java.util.List<java.lang.Exception> getFailureExceptions()
Returns all failure causing exceptions for thisRuleCompilerContext.
-
getProblems
java.util.List<RuleCompilerProblem> getProblems()
Returns all problems arose during compilation process.
-
addProblem
void addProblem(RuleCompilerProblem problem)
Adds a problem arose during compilation process to the list.- Parameters:
problem-
-
getConditionDefinitions
java.util.Map<java.lang.String,RuleConditionDefinitionData> getConditionDefinitions()
Returns condition definitions for rule
-
getActionDefinitions
java.util.Map<java.lang.String,RuleActionDefinitionData> getActionDefinitions()
Returns action definitions for rule
-
getRuleConditions
java.util.List<RuleConditionData> getRuleConditions()
Returns rule conditions for rule
-
getRuleCompilationContext
RuleCompilationContext getRuleCompilationContext()
get Rules compilation context for a given compilation- Returns:
- instance of
RuleCompilationContext
-
-