Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMN module returns the history of a decision evaluation #8112

Closed
Tracked by #8083
saig0 opened this issue Nov 1, 2021 · 1 comment · Fixed by #8734
Closed
Tracked by #8083

DMN module returns the history of a decision evaluation #8112

saig0 opened this issue Nov 1, 2021 · 1 comment · Fixed by #8734
Assignees
Labels
kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. scope/broker Marks an issue or PR to appear in the broker section of the changelog

Comments

@saig0
Copy link
Member

saig0 commented Nov 1, 2021

Description

The DMN module should return the history/audit of a decision evaluation together with the EvaluationResult. The history should include all relevant data from the evaluation, like the decision result, the intermediate results from required decisions, and the inputs and outputs of evaluated decision tables. The history will be used by the engine to write a history event on the log stream that can be consumed by Operate/Optimize.

  • add the history/audit to the EvaluationResult
  • the history should include the result from the evaluated decision
    • as the last item in the list of results
  • it should include the result from all required decisions that were evaluated
  • if the decision is a decision table then it should include the input values and the matched rules
  • if the decision is a literal expression then it should include only the result

The structure of the history could like this:

{
  "decisionResults": [
    {
      "decisionId": "x",
      "decisionName": "x",
      "decisionType": "x",
      "result": "x" (JSON),  
      "evaluatedInputs": [ (for decision tables) 
      	{
      	  "inputId": "x",
      	  "inputName": "x",
      	  "inputValue": "x" (JSON) 
      	}
      ],
      "matchedRules": [ (for decision tables)
      	{
      	  "ruleId": "x",
      	  "ruleIndex:": x,
      	  "evaluatedOutputs": [
  	    {
  	      "outputId": "x",
  	      "outputName": "x",
  	      "outputValue": "x" (JSON)
  	    } 
      	  ] 
      	}
      ]
    }
  ]  
}

blocked by #8082

@saig0 saig0 added kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. scope/broker Marks an issue or PR to appear in the broker section of the changelog labels Nov 1, 2021
@saig0 saig0 added this to the Evaluate DMN decisions milestone Nov 1, 2021
@saig0 saig0 added this to Planned in Zeebe Nov 1, 2021
@saig0
Copy link
Member Author

saig0 commented Nov 11, 2021

Alternatives

  • serialize the decision returns in a tree structure that represents the evaluation order (i.e. required decisions are child elements)
    • could be more complicated to deserialize
    • if needed, the structure could be constructed using the data of the DMN
  • reference to the parent decision
    • this relationship is currently not required
    • if needed, the structure could be constructed using the data of the DMN

@saig0 saig0 self-assigned this Jan 31, 2022
@saig0 saig0 moved this from Planned to In progress in Zeebe Jan 31, 2022
@npepinpe npepinpe moved this from In progress to Review in progress in Zeebe Feb 4, 2022
ghost pushed a commit that referenced this issue Feb 4, 2022
8734: DMN module returns the evaluated decisions r=saig0 a=saig0

## Description

* the result contains the output and the details of all evaluated decisions
* for an evaluated decision table, it contains the evaluated inputs, matched rules, and evaluated outputs
* if the evaluation fails then it contains all evaluated decisions until the failed decision

## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #8112 



Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
@ghost ghost closed this as completed in f09f1c1 Feb 4, 2022
Zeebe automation moved this from Review in progress to Done Feb 4, 2022
@KerstinHebel KerstinHebel removed this from Done in Zeebe Mar 23, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. scope/broker Marks an issue or PR to appear in the broker section of the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants