Class RuleGraph

java.lang.Object
com.aquima.interactions.rule.graph.RuleGraph
All Implemented Interfaces:
IRuleGraph

public class RuleGraph extends Object implements IRuleGraph
The rule graph class contains the node structure for all the attributes with the business rules that are applicable.
Since:
5.0
Author:
O. Kerpershoek
  • Constructor Details

    • RuleGraph

      public RuleGraph(IProject project, IMetaModel metamodel, IParserFactory parserFactory, IRuleFactory factory, IValidatorFactory validators, IConnectionManager connectionManager, IRuleEngineDS datasource)
      Constructs the rule graph with the required parameters.
      Parameters:
      project - Project containing various global definitions.
      metamodel - The metamodel for which the rule graph is constructed.
      parserFactory - Factory that should be used to parse expressions.
      factory - Factory that should be used to create custom rules.
      validators - Factory that can provide validator implementations.
      connectionManager - the connection manager
      datasource - Data-source that provides all the rule information needed to construct the graph.
      Throws:
      InitializationException - This exception is thrown when the graph could not be constructed due to a fatal initialization error.
  • Method Details

    • isR4Parser

      protected boolean isR4Parser()
      This method returns a boolean indicating if a R4 compatible parser is used. The R4 compatible flag will influence the way decision table conditions are 'fixed'.
      Returns:
      a boolean indicating if a R4 compatible parser is used.
    • isR4IgnoreScope

      protected boolean isR4IgnoreScope()
      This method returns a boolean that indicates if a scope error should be ignored by the R4 parser. Scope errors are fatal when the Aquima runtime is used to run the application, but can sometimes be ignored for applications that only use the validation.
      Returns:
      a boolean that indicates if a scope error should be ignored by the R4 parser.
    • getRuleGroup

      public IRuleGroup getRuleGroup(String name)
      Description copied from interface: IRuleGraph
      This method returns the rule group definition for the specified name.
      Specified by:
      getRuleGroup in interface IRuleGraph
      Parameters:
      name - The name of the requested rule group.
      Returns:
      The rule group definition for the specified name.
    • getEntityNode

      public IEntityNode getEntityNode(String entityName)
      Description copied from interface: IRuleGraph
      This method returns the IEntityNode of the dependency graph for the given entity name.
      Specified by:
      getEntityNode in interface IRuleGraph
      Parameters:
      entityName - The name of the entity.
      Returns:
      IEntityNode The entity node of the dependency graph for the given entity name.
    • getAttributeNode

      public IAttributeNode getAttributeNode(String entity, String attribute)
      Description copied from interface: IRuleGraph
      This method returns the IAttributeNodeof the dependency graph for the given attribute. When the attribute is not used by a business rule, this method may return null.
      Specified by:
      getAttributeNode in interface IRuleGraph
      Parameters:
      entity - The name of the entity that contains the attribute (this does not need to be the name of the entity in which the attribute is defined, but may also be the entity that contains the attribute by inheritance.
      attribute - The name of the attribute.
      Returns:
      IAttributeNode The attribute node of the dependency graph for the given attribute name, or null when the attribute has no dependencies.
    • getAllEntityNodes

      public IEntityNode[] getAllEntityNodes()
      Description copied from interface: IRuleGraph
      This method returns an array containing all the entity nodes present in the rule graph.
      Specified by:
      getAllEntityNodes in interface IRuleGraph
      Returns:
      Array containing all the entity nodes of the rule graph.
    • isDowncastAllowed

      protected boolean isDowncastAllowed()