Class RuleEngineTemplate
java.lang.Object
com.aquima.interactions.test.templates.AbstractReportingTemplate
com.aquima.interactions.test.templates.rules.RuleEngineTemplate
Template that may be used to initialize a rule engine.
- Since:
- 6.0
- Author:
- O. Kerpershoek
-
Constructor Summary
ConstructorDescriptionDefault constructor that generates a new initialization report.RuleEngineTemplate
(com.aquima.interactions.foundation.report.IInitializationReport report, ConfigurationTemplate config) Constructs the template with the required parameters. -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeDefault
(String attributeName, com.aquima.interactions.foundation.IValue defaultValue) Add a default value for an attribute.addAttributeDefault
(String attributeName, DecisionTableTemplate defRule) Add a default decision table for an attribute.addAttributeDefault
(String attributeName, String defaultExpression) Add a default expression for an attribute.void
addBusinessRule
(BusinessRuleTemplate businessRule) This method may be used to add a business rule to the rule engine.void
addConstraint
(com.aquima.interactions.rule.IConstraint rule) This method may be used to add a custom rule to the rule engine.addCsvDataRule
(String name, String csvConnectionName) This method adds a csv datarule to the rule engine.addDataRule
(String name) This method adds a datarule to the rule engine.addDecisionTable
(String name) This method may be used to add a decision table to the rule engine.addExpressionValidation
(String attribute, String expression, com.aquima.interactions.foundation.text.IMultilingualText message, boolean isWarning) Add an expression validation rule for an attribute.addExpressionValidation
(String attribute, String expression, String message, boolean isWarning) Add an expression validation rule for an attribute.addExternalConstaint
(String attributeName) addExternalSource
(String attributeName) void
addInferenceRule
(com.aquima.interactions.rule.IInferenceRule rule) This method may be used to add a custom rule to the rule engine.addRuleGroup
(String name) This method may be used to add a rule group.addValidation
(String attribute, com.aquima.interactions.framework.validator.ValidatorType validationType, com.aquima.interactions.foundation.text.IMultilingualText message, boolean isWarning) Add a validation rule for an attribute.addValidation
(String attribute, com.aquima.interactions.framework.validator.ValidatorType validationType, String message, boolean isWarning) Add a validation rule for an attribute.void
addValidationRule
(com.aquima.interactions.rule.IValidationRule rule) This method may be used to add a custom rule to the rule engine.protected Iterator
<com.aquima.interactions.rule.IConstraint> protected boolean
protected Iterator
<DefaultRuleTemplate> This method returns the expression engine template which can be used to specify custom reusable expressions.protected Iterator
<ExternalRuleTemplate> protected Iterator
<ExternalRuleTemplate> protected String
protected List
<RuleGroupTemplate> void
setAllowDowncast
(boolean allowDowncast) This method may be used to specify if the rule engine should allow down-casting of rules.com.aquima.interactions.rule.ds.IRuleEngineDS
This method converts the template to a data source that can be used to initialize a rule engine.Methods inherited from class com.aquima.interactions.test.templates.AbstractReportingTemplate
getInitializationReport
-
Constructor Details
-
RuleEngineTemplate
public RuleEngineTemplate()Default constructor that generates a new initialization report. -
RuleEngineTemplate
public RuleEngineTemplate(com.aquima.interactions.foundation.report.IInitializationReport report, ConfigurationTemplate config) Constructs the template with the required parameters.- Parameters:
report
- The initialization report that should be used to add errors and warnings to.config
- Object containing configurable settings for the rule engine.
-
-
Method Details
-
doesAllowDowncast
protected boolean doesAllowDowncast() -
setAllowDowncast
public void setAllowDowncast(boolean allowDowncast) This method may be used to specify if the rule engine should allow down-casting of rules.- Parameters:
allowDowncast
- Boolean indicating if the rule engine should allow down-casting of rules.
-
getParserVersion
-
addConstraint
public void addConstraint(com.aquima.interactions.rule.IConstraint rule) This method may be used to add a custom rule to the rule engine.- Parameters:
rule
- The custom rule that should be added.
-
constraintRules
-
addValidationRule
public void addValidationRule(com.aquima.interactions.rule.IValidationRule rule) This method may be used to add a custom rule to the rule engine.- Parameters:
rule
- The custom rule that should be added.
-
addValidation
public ValidationTemplate addValidation(String attribute, com.aquima.interactions.framework.validator.ValidatorType validationType, String message, boolean isWarning) Add a validation rule for an attribute.- Parameters:
attribute
- The attribute's full namevalidationType
- The validation typemessage
- The validation messageisWarning
- Indicator if the validation message is a warning- Returns:
- The created validation template.
-
addValidation
public ValidationTemplate addValidation(String attribute, com.aquima.interactions.framework.validator.ValidatorType validationType, com.aquima.interactions.foundation.text.IMultilingualText message, boolean isWarning) Add a validation rule for an attribute.- Parameters:
attribute
- The attribute's full namevalidationType
- The validation typemessage
- The validation messageisWarning
- Indicator if the validation message is a warning- Returns:
- The created validation template.
- Since:
- 8.4
-
addExpressionValidation
public ValidationTemplate addExpressionValidation(String attribute, String expression, String message, boolean isWarning) Add an expression validation rule for an attribute.- Parameters:
attribute
- The attribute's full nameexpression
- The expressionmessage
- The validation messageisWarning
- Indicator if the validation message is a warning- Returns:
- The created validation template.
-
addExpressionValidation
public ValidationTemplate addExpressionValidation(String attribute, String expression, com.aquima.interactions.foundation.text.IMultilingualText message, boolean isWarning) Add an expression validation rule for an attribute.- Parameters:
attribute
- The attribute's full nameexpression
- The expressionmessage
- The validation messageisWarning
- Indicator if the validation message is a warning- Returns:
- The created validation template.
- Since:
- 8.4
-
getValidationRules
-
addInferenceRule
public void addInferenceRule(com.aquima.interactions.rule.IInferenceRule rule) This method may be used to add a custom rule to the rule engine.- Parameters:
rule
- The custom rule that should be added.
-
addDecisionTable
This method may be used to add a decision table to the rule engine.- Parameters:
name
- The name of the decision table that should be added.- Returns:
- A decision table template representing the table that was added.
-
addBusinessRule
This method may be used to add a business rule to the rule engine.- Parameters:
businessRule
- The decision table that should be added.
-
getInferenceRules
-
addAttributeDefault
public DefaultRuleTemplate addAttributeDefault(String attributeName, com.aquima.interactions.foundation.IValue defaultValue) Add a default value for an attribute.- Parameters:
attributeName
- Attribute full name: EntityName.AttributeNamedefaultValue
- Value used as default.- Returns:
- Template representing the default rule.
-
addAttributeDefault
Add a default expression for an attribute.- Parameters:
attributeName
- Attribute full name: EntityName.AttributeNamedefaultExpression
- Expression to be used as default.- Returns:
- Template representing the default rule.
-
addAttributeDefault
Add a default decision table for an attribute.- Parameters:
attributeName
- Attribute full name: EntityName.AttributeNamedefRule
- The decision table to be used as default.- Returns:
- Template representing the default rule.
-
getDefaults
-
addRuleGroup
This method may be used to add a rule group.- Parameters:
name
- The name of the rule group that should be added.- Returns:
- Template representing the newly added rule group.
-
getRuleGroups
-
toDataSource
public com.aquima.interactions.rule.ds.IRuleEngineDS toDataSource()This method converts the template to a data source that can be used to initialize a rule engine.- Returns:
- a data source that can be used to initialize a rule engine.
-
getExpressionEngine
This method returns the expression engine template which can be used to specify custom reusable expressions.- Returns:
- the expression engine template which can be used to specify custom reusable expressions.
-
addCsvDataRule
This method adds a csv datarule to the rule engine.- Parameters:
name
- The name of the rule.csvConnectionName
- The name of the resource connection that should be used to get csv data.- Returns:
- The added data rule template.
-
addDataRule
This method adds a datarule to the rule engine.- Parameters:
name
- The name of the rule.- Returns:
- The added data rule template.
-
getExternalSources
-
getExternalConstraints
-
addExternalSource
-
addExternalConstaint
-