Cannot execute chain decisions in Camunda

I cannot execute below DRD in Camunda 8 Self-managed version. I have verified with DMN Online Simulator and it works, yet once deployed it always return

Expected to evaluate decision 'decision_Vehicle', but failed to evaluate expression 'city': no variable found for name 'city'

DMN tables

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" id="Def_RouteToCity" name="Routing Based On POD and Cont Type" namespace="http://camunda.org/schema/1.0/dmn" exporter="Camunda Modeler" exporterVersion="5.4.2" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.1.0">
  <decision id="decision_RouteToCity" name="Decide Where to Route">
    <informationRequirement id="InformationRequirement_0e0n7kg">
      <requiredInput href="#pod" />
    </informationRequirement>
    <informationRequirement id="InformationRequirement_11cpifb">
      <requiredInput href="#cont_type" />
    </informationRequirement>
    <decisionTable id="DecisionTable_0h5pigm" hitPolicy="FIRST">
      <input id="Input_1" label="Port of Discharge">
        <inputExpression id="InputExpression_1" typeRef="string">
          <text>pod</text>
        </inputExpression>
      </input>
      <input id="InputClause_0ea0qat" label="Container Type">
        <inputExpression id="LiteralExpression_0av4kld" typeRef="string">
          <text>cont_type</text>
        </inputExpression>
        <inputValues id="UnaryTests_1xywiq0">
          <text>"40","20"</text>
        </inputValues>
      </input>
      <output id="Output_1" label="City" name="city" typeRef="string" />
      <rule id="DecisionRule_0sl09kl">
        <inputEntry id="UnaryTests_14k5ejx">
          <text>"LAX"</text>
        </inputEntry>
        <inputEntry id="UnaryTests_05qw1uu">
          <text>"20"</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0lb99ch">
          <text>"Los Angeles"</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_1tpiorl">
        <inputEntry id="UnaryTests_0wtz3hb">
          <text>"SGN"</text>
        </inputEntry>
        <inputEntry id="UnaryTests_1tw08tj">
          <text></text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0g0er3w">
          <text>"Sai Gon"</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_172umfd">
        <inputEntry id="UnaryTests_0cckw77">
          <text>"LAX"</text>
        </inputEntry>
        <inputEntry id="UnaryTests_19vwvp5">
          <text></text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0sec54s">
          <text>"San Francisco"</text>
        </outputEntry>
      </rule>
    </decisionTable>
  </decision>
  <inputData id="pod" name="POD" />
  <inputData id="cont_type" name="Cont Type" />
  <decision id="decision_Vehicle" name="Decide which vehicle">
    <informationRequirement id="InformationRequirement_18ksg18">
      <requiredDecision href="#decision_RouteToCity" />
    </informationRequirement>
    <decisionTable id="DecisionTable_1spzl7p" hitPolicy="FIRST">
      <input id="InputClause_0pyi2fl" label="City">
        <inputExpression id="LiteralExpression_12xrtfy" typeRef="string">
          <text>city</text>
        </inputExpression>
      </input>
      <input id="InputClause_0wjiymd" label="Container Type">
        <inputExpression id="LiteralExpression_09agea3" typeRef="string">
          <text>cont_type</text>
        </inputExpression>
        <inputValues id="UnaryTests_0jk81u1">
          <text>"40","20"</text>
        </inputValues>
      </input>
      <output id="OutputClause_1okg5q3" label="Vehicle" name="vehicle" typeRef="string" />
      <rule id="DecisionRule_0seu26t">
        <inputEntry id="UnaryTests_03at4fk">
          <text>"Sai Gon"</text>
        </inputEntry>
        <inputEntry id="UnaryTests_0bnfr2v">
          <text>"20"</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_1nxlloi">
          <text>"truck"</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_0a7x6bv">
        <inputEntry id="UnaryTests_1c3dmf3">
          <text>"Los Angeles"</text>
        </inputEntry>
        <inputEntry id="UnaryTests_002pptq">
          <text></text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0x7racp">
          <text>"truck"</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_10irj9v">
        <inputEntry id="UnaryTests_067q037">
          <text>"San Francisco"</text>
        </inputEntry>
        <inputEntry id="UnaryTests_143dqgg">
          <text></text>
        </inputEntry>
        <outputEntry id="LiteralExpression_1hut81h">
          <text>"airplane"</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_0h2fci9">
        <inputEntry id="UnaryTests_08cq9xl">
          <text></text>
        </inputEntry>
        <inputEntry id="UnaryTests_1szpj6g">
          <text>"40"</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_1na7mjx">
          <text>"train"</text>
        </outputEntry>
      </rule>
    </decisionTable>
  </decision>
  <dmndi:DMNDI>
    <dmndi:DMNDiagram>
      <dmndi:DMNShape dmnElementRef="decision_RouteToCity">
        <dc:Bounds height="80" width="180" x="250" y="220" />
      </dmndi:DMNShape>
      <dmndi:DMNShape id="DMNShape_03081tp" dmnElementRef="pod">
        <dc:Bounds height="45" width="125" x="158" y="358" />
      </dmndi:DMNShape>
      <dmndi:DMNShape id="DMNShape_1peoezf" dmnElementRef="cont_type">
        <dc:Bounds height="45" width="125" x="427" y="358" />
      </dmndi:DMNShape>
      <dmndi:DMNEdge id="DMNEdge_1ualc1s" dmnElementRef="InformationRequirement_0e0n7kg">
        <di:waypoint x="221" y="358" />
        <di:waypoint x="310" y="320" />
        <di:waypoint x="310" y="300" />
      </dmndi:DMNEdge>
      <dmndi:DMNEdge id="DMNEdge_1a02i0d" dmnElementRef="InformationRequirement_11cpifb">
        <di:waypoint x="490" y="358" />
        <di:waypoint x="370" y="320" />
        <di:waypoint x="370" y="300" />
      </dmndi:DMNEdge>
      <dmndi:DMNShape id="DMNShape_0oje2zz" dmnElementRef="decision_Vehicle">
        <dc:Bounds height="80" width="180" x="400" y="80" />
      </dmndi:DMNShape>
      <dmndi:DMNEdge id="DMNEdge_1qrh46i" dmnElementRef="InformationRequirement_18ksg18">
        <di:waypoint x="340" y="220" />
        <di:waypoint x="490" y="180" />
        <di:waypoint x="490" y="160" />
      </dmndi:DMNEdge>
    </dmndi:DMNDiagram>
  </dmndi:DMNDI>
</definitions>

Can you show how exactly you trigger the DMN table?

I trigger the DMN with BPMN flow below from the Modeler

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0ndnztv" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.4.2" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.1.0">
  <bpmn:process id="process_WhereToRoute" name="Where To Route" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:outgoing>Flow_01m523h</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="Flow_01m523h" sourceRef="StartEvent_1" targetRef="Activity_1silmgi" />
    <bpmn:sequenceFlow id="Flow_1lrww6r" sourceRef="Activity_1regsbj" targetRef="Event_1vrgd6e" />
    <bpmn:businessRuleTask id="Activity_1silmgi" name="Routing">
      <bpmn:extensionElements>
        <zeebe:calledDecision decisionId="decision_Vehicle" resultVariable="result" />
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_01m523h</bpmn:incoming>
      <bpmn:outgoing>Flow_089jbpr</bpmn:outgoing>
    </bpmn:businessRuleTask>
    <bpmn:endEvent id="Event_1vrgd6e">
      <bpmn:incoming>Flow_1lrww6r</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_089jbpr" sourceRef="Activity_1silmgi" targetRef="Activity_1regsbj" />
    <bpmn:userTask id="Activity_1regsbj" name="Stop">
      <bpmn:incoming>Flow_089jbpr</bpmn:incoming>
      <bpmn:outgoing>Flow_1lrww6r</bpmn:outgoing>
    </bpmn:userTask>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process_WhereToRoute">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="179" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_084vl9z_di" bpmnElement="Activity_1silmgi">
        <dc:Bounds x="360" y="77" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1vrgd6e_di" bpmnElement="Event_1vrgd6e">
        <dc:Bounds x="842" y="92" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0bk0nox_di" bpmnElement="Activity_1regsbj">
        <dc:Bounds x="600" y="190" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_01m523h_di" bpmnElement="Flow_01m523h">
        <di:waypoint x="215" y="117" />
        <di:waypoint x="360" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1lrww6r_di" bpmnElement="Flow_1lrww6r">
        <di:waypoint x="650" y="190" />
        <di:waypoint x="650" y="163" />
        <di:waypoint x="860" y="163" />
        <di:waypoint x="860" y="128" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_089jbpr_di" bpmnElement="Flow_089jbpr">
        <di:waypoint x="460" y="117" />
        <di:waypoint x="530" y="117" />
        <di:waypoint x="530" y="230" />
        <di:waypoint x="600" y="230" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

This is the result of a simple chain decisions on Operate


Can you provide the DMN file?

There is one peculiarity, which confuses users new to Camunda’s DMN:
Within one DMN, you refer to the output of decisions via the decision ID.

In Test 2, you can refer to the result of Test 1 via the ID of the decision “Test 1”.
Let’s say the IDs are Test2, and Test1 respectively. The input variable of Test 2 should be “Test1” instead of “num”.

1 Like

thank you. I use the ID of required decision table and it works. Wonder why DMN simulator works so different.