Class InferenceRuleVisitor
java.lang.Object
com.aquima.interactions.rule.graph.RuleVisitor
com.aquima.interactions.rule.graph.InferenceRuleVisitor
- All Implemented Interfaces:
IRuleVisitor
,ISourceVisitor
Rule visitor that is used during initialization to add the inference rules to the rule graph.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Constructor Summary
ConstructorsConstructorDescriptionInferenceRuleVisitor
(RuleGraph graph, IProject project, IMetaModel model, IRuleFactory ruleFactory, IParserFactory parserFactory, IConnectionManager connectionManager, IReportingDS report) Constructs a rule visitor with the required parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDataRule
(IDataRuleDS dataRule) This method may be used to add a data rule to the rule engine.void
addDefaultRule
(IDefaultRuleDS defaultDS) This method may be used to add a default rule to the rule graph.protected void
addDefaultTable
(IExpressionParser parser, String attribute, IDecisionTableDS source) void
addExternalSource
(IExternalRuleDS externalRule) The data layer may invoke this method to add an external inference rule.void
addRule
(IBusinessRuleDS source) This method may be used to add a business rule (IF-THEN rule) to the rule engine.void
addSource
(IInferenceRule rule) This method may be used to add a custom inference rule to the rule engine.void
addTable
(IDecisionTableDS source) This method may be used to add a decision table to the rule engine.Methods inherited from class com.aquima.interactions.rule.graph.RuleVisitor
getConnectionManager, getMetaModel, getParser, getProject, isR4IgnoreScope, isR4Parser, isSingletonOrNamed, validateRuleGroups, validateSourceScopeObjects, validateTargetAttributes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aquima.interactions.rule.ds.IRuleVisitor
getMetaModel, getParser
-
Constructor Details
-
InferenceRuleVisitor
public InferenceRuleVisitor(RuleGraph graph, IProject project, IMetaModel model, IRuleFactory ruleFactory, IParserFactory parserFactory, IConnectionManager connectionManager, IReportingDS report) Constructs a rule visitor with the required parameters.- Parameters:
graph
- The rule graph that should be used to add the rules to.project
- the projectmodel
- The metamodel definition of the current application.ruleFactory
- The rule factory that should be used to locate external rules.parserFactory
- Factory that may be used to parse rules.connectionManager
- The connection manager used to locate connections.report
- The report that should be used to add error or warnings to.
-
-
Method Details
-
addSource
Description copied from interface:ISourceVisitor
This method may be used to add a custom inference rule to the rule engine.- Specified by:
addSource
in interfaceISourceVisitor
- Parameters:
rule
- The custom implementation of the inference rule interface.
-
addExternalSource
Description copied from interface:ISourceVisitor
The data layer may invoke this method to add an external inference rule. The rule factory will be used to locate the implementation for the inference rule.- Specified by:
addExternalSource
in interfaceISourceVisitor
- Parameters:
externalRule
- Data source providing information about the external inference rule.
-
addTable
Description copied from interface:ISourceVisitor
This method may be used to add a decision table to the rule engine.- Specified by:
addTable
in interfaceISourceVisitor
- Parameters:
source
- Data source capable of providing the data needed to initialize a decision table.
-
addRule
Description copied from interface:ISourceVisitor
This method may be used to add a business rule (IF-THEN rule) to the rule engine.- Specified by:
addRule
in interfaceISourceVisitor
- Parameters:
source
- Data source capable of providing the data needed to initialize a business rule.
-
addDefaultRule
Description copied from interface:ISourceVisitor
This method may be used to add a default rule to the rule graph. Default rules are different from normal inference rules as they may source a value for only a single attribute, and will be executed after all the other rules have been evaluated.- Specified by:
addDefaultRule
in interfaceISourceVisitor
- Parameters:
defaultDS
- Data source providing the information for the default rule.
-
addDefaultTable
-
addDataRule
Description copied from interface:ISourceVisitor
This method may be used to add a data rule to the rule engine.- Specified by:
addDataRule
in interfaceISourceVisitor
- Parameters:
dataRule
- Data source capable of providing the data needed to initialize a data rule.
-