Interface IRuleEngineDS

All Superinterfaces:
IReportingDS
All Known Implementing Classes:
ConfigRuleEngineDS, ConfigRuleEngineDS, ReportingRuleEngineDS, RuleEngineDelegateDS, RuleEngineDS, XmlRuleEngineDS, XmlRuleEngineDS

public interface IRuleEngineDS extends IReportingDS
This interface defines the main functions that a data layer for a rule engine should implement to initialize the various business rules.
Since:
5.0
Author:
O. Kerpershoek
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Category
    Category used in error and/or warnings found during initialization.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Given a rule that can source a target attribute, it uses source attributes.
    This function returns the data source for the expression parser.
    This method returns the version of the parser that should be used.
    void
    The rule engine will invoke this method to allow the data layer to add constraints for attributes to the rule engine.
    void
    The rule engine will invoke this method to allow the data layer to add the rule group definitions to the rule engine.
    void
    The rule engine will invoke this method to allow the data layer to add to add sources for attributes to the rule engine.
    void
    The rule engine will invoke this method to allow the data layer to add a validation rule for an attribute to the rule engine.

    Methods inherited from interface com.aquima.interactions.foundation.report.IReportingDS

    addMessage
  • Field Details

    • CATEGORY

      static final Category CATEGORY
      Category used in error and/or warnings found during initialization.
  • Method Details

    • allowTargetDowncast

      boolean allowTargetDowncast()
      Given a rule that can source a target attribute, it uses source attributes. In KS-4.2 one can define A rule that sources Item.price while using the subtype Product in the expression. If the allowTarget upcast function is true the second case: Sourcing with Item.prijs using Product.naam will auto upcast Item.prijs to Product.prijs. This makes the the rule valid and used when product.prijs is requested.
      1. Item.prijs <= Item.naam
      2. Item.prijs <= Product.naam
      3. Product.prijs <= Item.naam
      4. Product.prijs <= Product.naam
      Returns:
      boolean indicating if down-casting of rules is allowed.
    • getParserVersion

      Version getParserVersion()
      This method returns the version of the parser that should be used. At the moment there are two parser versions available:
      • Version 4.x and lower, which will only accept expressions in the original syntax.
      • Version 5.x or higher, which will accept most of the original syntax and several new expression constructs.
      Returns:
      The version of the parser that should be used.
    • iterateRuleGroups

      void iterateRuleGroups(IRuleGroupVisitor visitor)
      The rule engine will invoke this method to allow the data layer to add the rule group definitions to the rule engine.
      Parameters:
      visitor - The visitor that should be used to add the rule groups to.
      Throws:
      InitializationException - This exception is thrown when the rule groups could not be initialized.
    • iterateSources

      void iterateSources(ISourceVisitor visitor)
      The rule engine will invoke this method to allow the data layer to add to add sources for attributes to the rule engine.
      Parameters:
      visitor - The visitor that should be used to add the source to.
      Throws:
      InitializationException - This exception is raised when a rule could not be added due to errors.
    • iterateConstraints

      void iterateConstraints(IConstraintVisitor visitor)
      The rule engine will invoke this method to allow the data layer to add constraints for attributes to the rule engine.
      Parameters:
      visitor - The visitor that should be used to add the constraints to.
      Throws:
      InitializationException - This exception is raised when a rule could not be added due to errors.
    • iterateValidations

      void iterateValidations(IValidationVisitor visitor)
      The rule engine will invoke this method to allow the data layer to add a validation rule for an attribute to the rule engine.
      Parameters:
      visitor - The visitor that should be used to add the validation to.
      Throws:
      InitializationException - This exception is raised when a rule could not be added due to errors.
    • getExpressionEngineDS

      IExpressionEngineDS getExpressionEngineDS()
      This function returns the data source for the expression parser.
      Returns:
      The parser data source which is mandatory.