Interface IRuleEngine

All Known Implementing Classes:
RuleEngine

public interface IRuleEngine
Interface for the rule engine. This interface provides various methods that enable the client to work with business rules. This class is not serializable.
Since:
5.0
Author:
O. Kerpershoek, F. van der Meer
  • Method Details

    • getRuleGraph

      IRuleGraph getRuleGraph()
      This method returns an object containing an internal structure representation of all the business rules that are present in the rule engine.
      Returns:
      Structure containing information about the rules present in the rule engine.
    • getExpressionParser

      IExpressionParser getExpressionParser()
      This method returns a parser which can be used to parse expressions.
      Returns:
      a parser which can be used to parse expressions.
    • getParserFactory

      IParserFactory getParserFactory()
      This method returns a parser factory which can be used to create expression parsers with a context listener.
      Returns:
      A parser which can be used to create expression parsers for specific listeners.
    • getValidator

      IValidator getValidator(String name)
      This method returns a (custom) validator implementation for the specified type, using the provided parameters to initialize it.
      Parameters:
      name - The validator type name for which an implementation is requested.
      Returns:
      Validator implementation of the requested type.
      Throws:
      UnknownValidatorException - This exception is thrown when the validator type is unknown.
    • sourceAttribute

      InferenceResult[] sourceAttribute(IProfile profile, ValueReference valueReference, IRuleListener listener)
      This method does not check if the profile already contains a value for the given reference, but will always source a value for the attribute. This method will return an inference result object in the result array for each rule that has been evaluated. Also rules that did not yield a value for the target attribute will be present in this array. The reason to include all inference results is that the dependency information on the failed rules is needed to determine whether the target attribute may need to be inferenced again when one of the dependencies of the failed rules changes.
      Parameters:
      profile - The profile that should be used when evaluating the business rules.
      valueReference - The attribute whose value should be inferenced.
      listener - Optional listener that may be used to intercept events.
      Returns:
      Array containing the results of the inference actions that were triggered.
      Throws:
      AppException - This exception is raised when the source action failed due to an unexpected error.
    • getJustification

      JustificationTree getJustification(IProfile profile, ValueReference valueReference, JustificationDepth depth)
      This method determines the justification tree for the specified value.
      Parameters:
      profile - The profile containing the inferenced values.
      valueReference - The value for which the justification tree should be generated.
      depth - The depth of the justification tree that should be generated.
      Returns:
      The justification tree for the specified value.
      Throws:
      AppException - This exception is thrown when the justification tree could not be determined.
    • getDMNDecisionTree

      DMNDecisionTree getDMNDecisionTree(IProfile profile, ValueReference valueReference)
      This method determines the decision tree for the specified value.
      Parameters:
      profile - The profile containing the inferred values.
      valueReference - The value for which the DMN decision tree should be generated.
      Returns:
      The DMN decision tree for the specified value.
      Throws:
      AppException - This exception is thrown when the DMN decision tree could not be determined.
    • getDMNDecisionTree

      DMNDecisionTree getDMNDecisionTree(IProfile profile, IExpression expression, String description)
      This method determines the decision tree for the specified expression.
      Parameters:
      profile - The profile contained the inferred values.
      expression - The value for which the DMN decision tree should be generated.
      description - A description for the expression
      Returns:
      The DMN decision tree for the specified value.
      Throws:
      AppException - This exception is thrown when the DMN decision tree could not be determined.
    • determineDomain

      IPrimitiveValue[] determineDomain(IProfile profile, ValueReference valueReference, IDomainDefinition definition)
      This method will determine the set of valid values for the specified attribute.
      Parameters:
      profile - The profile that should be used when evaluating the constraints.
      valueReference - Reference to the attribute for which the valid set of values should be determined.
      definition - The domain definition of the attribute for which the constrains should be evaluated.
      Returns:
      Array containing all the valid values for the specified attribute.
      Throws:
      AppException - This exception is raised when the constraint action failed due to an unexpected error.
    • validateAttribute

      IValidationResult validateAttribute(IProfile profile, ValueReference reference)
      This method will validate the value of the specified attribute, and return a result containing information about all the validation rules that were processed with their result.
      Parameters:
      profile - The profile that contains the value(s) to be validated.
      reference - Reference to the attribute whose value should be validated.
      Returns:
      Object containing the results of the validation action.
      Throws:
      AppException - This exception is raised when the validation action failed due to an unexpected error.