Interface DecisionEngine

All Known Implementing Classes:
DmnScalaDecisionEngine

public interface DecisionEngine
Parses and evaluates DMN decisions. A DMN resource can be parsed and stored as a decision requirements graph, containing 1 or more decisions and their requirements.

A parsed decision requirements graph can be used to evaluate a decision with a given variable context. If successful, it leads to a decision result.

  • Method Details

    • parse

      Parses the given DMN resource into a parsed decision requirements graph, containing the decision and its requirements.

      If the DMN is not valid then it returns a result object that contains the failure message, instead of throwing an exception.

      Parameters:
      dmnResource - the DMN resource as input stream
      Returns:
      the parsed decision requirements graph, or the failure message if the DMN is not valid
    • evaluateDecisionById

      DecisionEvaluationResult evaluateDecisionById(ParsedDecisionRequirementsGraph decisionRequirementsGraph, String decisionId, DecisionContext context)
      Evaluates a decision in the provided decision requirements graph.

      If the decision could not be evaluated successfully, then it returns a result object that contains the evaluation failure instead of throwing an exception.

      Parameters:
      decisionRequirementsGraph - the graph containing the decision to evaluate and all its requirements
      decisionId - the id of the decision to evaluate
      context - the evaluation context used to evaluate the decision
      Returns:
      the result of evaluating the decision, or the evaluation failure if the decision could not be evaluated successfully