Get Intermediate DMN decisions in execution result

119 Views Asked by At

I have to create a DMN model with mmore than 50 DMN decisions (structured like a tree) in Business central .I have splitted it in different Decision services to not have a large DMN model (difficult to maintain). I want to see the results of each Decision (intermediate & final decisions) but using Decision service hide the results of intermediate decisions.

DMN model

Is it a way to get the result of Decisions R_0_X_X in the DMN evaluation results?

I got no details for Decisions below R_0 in DMN execution result:

        "R_0": {
            "R_0_Eval_agent_bankklantDS": "function R_0_Eval_agent_bankklantDS( input )"
        },
        "R_0_Eval_agent_bankklant": "B",
        "R_1_Voorlopige_eindevaluatie": "green",
        "evaluationResult": "green"
1

There are 1 best solutions below

0
tarilabs On

but using Decision service hide the results of intermediate decisions

That is the goal of Decision Service semantic in DMN, it encapsulates some of the logic, as only the outputDecisions are available as a result of the invocation, while encapsulatedDecision are not to be made available in the results.

I assume you need the "results of intermediate decisions" for debugging information, in that case implementing your own DMNRuntimeEventListener is the appropriate strategy:

References:

https://docs.drools.org/7.74.0.Final/drools-docs/html_single/index.html#dmn-properties-ref_dmn-models:~:text=org.kie.dmn.runtime.listeners.%24LISTENER_NAME

https://github.com/kiegroup/drools/blob/948a4482b4499efed8c28ce4a626af5f942aa9ad/kie-dmn/kie-dmn-api/src/main/java/org/kie/dmn/api/core/event/DMNRuntimeEventListener.java#L19