Dmn.Result (dmn v0.1.0)

Copy Markdown View Source

What Dmn.evaluate_all/4 gives: the values of the decisions that were asked for, and the diagnostics of every element that was run.

FieldIs
valuesthe value of each decision asked for, by the name it was asked for by
diagnosticsthe Dmn.Diagnostics of the run, in the order the elements ran, each with the element and the place in it; the errors of an element that could not be compiled are here too
ranthe keys of the elements that were run, in order

Summary

Functions

The diagnostics of an element, by its key.

Types

t()

@type t() :: %Dmn.Result{
  diagnostics: [Dmn.Diagnostic.t()],
  ran: [Dmn.Compiled.key()],
  values: %{optional(String.t()) => Feel.Value.t()}
}

Functions

diagnostics(result, element)

@spec diagnostics(t(), String.t()) :: [Dmn.Diagnostic.t()]

The diagnostics of an element, by its key.

iex> result = %Dmn.Result{diagnostics: [Dmn.Diagnostic.new(:error, :x, "x", element: "d1"), Dmn.Diagnostic.new(:info, :y, "y", element: "d2")]}
iex> Enum.map(Dmn.Result.diagnostics(result, "d1"), & &1.code)
[:x]