Class DmnScalaDecisionEngine

java.lang.Object
io.camunda.zeebe.dmn.impl.DmnScalaDecisionEngine
All Implemented Interfaces:
DecisionEngine

public final class DmnScalaDecisionEngine extends Object implements DecisionEngine
A wrapper around the DMN-Scala decision engine.

  • GitHub Repository
  • Documentation
    • Constructor Details

      • DmnScalaDecisionEngine

        public DmnScalaDecisionEngine()
    • Method Details

      • parse

        public ParsedDecisionRequirementsGraph parse(InputStream dmnResource)
        Description copied from interface: DecisionEngine
        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.

        Specified by:
        parse in interface DecisionEngine
        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

        public DecisionEvaluationResult evaluateDecisionById(ParsedDecisionRequirementsGraph decisionRequirementsGraph, String decisionId, DecisionContext context)
        Description copied from interface: DecisionEngine
        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.

        Specified by:
        evaluateDecisionById in interface DecisionEngine
        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