How to return applied rule(s)


#1

Hello everyone,

I’m currently trying to not only get the output result from my DmnDecisionTableResult but get the DMN engine to return the rule this output result belongs to.
My guess is it is possible to return it, I am just not looking at the right place.

The DMN Online Simulator automatically highlights the correct rule which was found and when I fooled around with https://dmn.lab.camunda.com/ I can see a rule response, which is exactly what I am looking for.

{
  "outputs": {
    "dish": {
      "type": "string",
      "values": [
        "Light Salad and a nice Steak"
      ]
    }
  },
  "rules": [
    {
      "ruleId": "row-950612891-6",
      "outputs": {
        "dish": {
          "type": "string",
          "value": "Light Salad and a nice Steak"
        }
      }
    }
  ]
}

How can I get this rules returned by the JAVA API?

Thanks in advance!


#2

Hi @divY42,

you can get the information from the history. When a decision is evaluated within Camunda BPM then the history is written. It contains which rules are matched and more.

Best regards,
Philipp


#3

HI – Can you tell me exactly which object provides the rule history ?


#4

Never mind. I figured it out.
Had to add a PostDecisionTableEvaluationListeners to the config to get that information.