How to get rule details of decision (Completed!)

Define a decision for a BusinessRuleTask as below, i want get hit rule detail when process executed specific decison after, example i need rule that output equals ‘reject’ lines, i will store that recored to db but only get output result from class org.camunda.bpm.dmn.engine.DmnDecisionResult. After i read doc for camunda i realized that a HistoryService ability to get more information about decision, History of Evaluated Decisions

Below is my decision definition, i just get content with tag equals , i know camunda Cockipt will highlight if a rule hit, but i want restore that to db.

How to do it?

Thanks.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd" xmlns:biodi="http://bpmn.io/schema/dmn/biodi/1.0" xmlns:camunda="http://camunda.org/schema/1.0/dmn" id="Definitions_1azwa73" name="DRD" namespace="http://camunda.org/schema/1.0/dmn" exporter="Camunda Modeler" exporterVersion="3.3.4">
  <decision id="decision1" name="Decision 1">
    <extensionElements>
      <biodi:bounds x="150" y="150" width="180" height="80" />
    </extensionElements>
    <decisionTable id="decisionTable_1" hitPolicy="RULE ORDER">
      <input id="input_1" label="Code" camunda:inputVariable="recored">
        <inputExpression id="inputExpression_1" typeRef="integer">
          <text>code</text>
        </inputExpression>
      </input>
      <output id="output_1" label="Advice" name="advice" typeRef="string" />
      <rule id="DecisionRule_09e42qn">
        <inputEntry id="UnaryTests_1hfmb4d" expressionLanguage="feel">
          <text>200</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0mini0s">
          <text>"accept"</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_1vv6cjl">
        <inputEntry id="UnaryTests_0k9keoc" expressionLanguage="feel">
          <text>&gt; 404</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0fexgz6">
          <text>"reject"</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_0pyjtfv">
        <inputEntry id="UnaryTests_1uynqnb">
          <text>&gt; 300</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_06jcz2h">
          <text>"reject"</text>
        </outputEntry>
      </rule>
    </decisionTable>
  </decision>
</definitions>

For questions regarding Camunda BPM please head over to the Camunda Forum.

Ok it’s my problem, thank you.

1 Like