Class InferenceRuleVisitor

java.lang.Object
com.aquima.interactions.rule.graph.RuleVisitor
com.aquima.interactions.rule.graph.InferenceRuleVisitor
All Implemented Interfaces:
IRuleVisitor, ISourceVisitor

public class InferenceRuleVisitor extends RuleVisitor implements ISourceVisitor
Rule visitor that is used during initialization to add the inference rules to the rule graph.
Since:
5.0
Author:
O. Kerpershoek
  • 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 project
      model - 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

      public void addSource(IInferenceRule rule)
      Description copied from interface: ISourceVisitor
      This method may be used to add a custom inference rule to the rule engine.
      Specified by:
      addSource in interface ISourceVisitor
      Parameters:
      rule - The custom implementation of the inference rule interface.
    • addExternalSource

      public void addExternalSource(IExternalRuleDS externalRule)
      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 interface ISourceVisitor
      Parameters:
      externalRule - Data source providing information about the external inference rule.
    • addTable

      public void addTable(IDecisionTableDS source)
      Description copied from interface: ISourceVisitor
      This method may be used to add a decision table to the rule engine.
      Specified by:
      addTable in interface ISourceVisitor
      Parameters:
      source - Data source capable of providing the data needed to initialize a decision table.
    • addRule

      public void addRule(IBusinessRuleDS source)
      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 interface ISourceVisitor
      Parameters:
      source - Data source capable of providing the data needed to initialize a business rule.
    • addDefaultRule

      public void addDefaultRule(IDefaultRuleDS defaultDS)
      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 interface ISourceVisitor
      Parameters:
      defaultDS - Data source providing the information for the default rule.
    • addDefaultTable

      protected void addDefaultTable(IExpressionParser parser, String attribute, IDecisionTableDS source)
    • addDataRule

      public void addDataRule(IDataRuleDS dataRule)
      Description copied from interface: ISourceVisitor
      This method may be used to add a data rule to the rule engine.
      Specified by:
      addDataRule in interface ISourceVisitor
      Parameters:
      dataRule - Data source capable of providing the data needed to initialize a data rule.