Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-14666

Fetching external tasks with multiple topics returns incorrect results

    XMLWordPrintable

Details

    • Bug Report
    • Resolution: Unresolved
    • L3 - Default
    • None
    • 7.16.0, 7.18.0-alpha1
    • None
    • None

    Description

      Environment: 

      Camunda BPM platform Docker image (versions checked: 7.16.0, 7.18.0-alpha1), Minikube v1.14.2, Ubuntu 18.04

      Description:

      While fetch-and-locking external tasks via the REST API (/engine-rest/external-task/fetchAndLock), no tasks are returned when multiple topic definitions are defined in the request with disjoint criteria.

      Steps to reproduce (Required on creation):

      1. Deploy this example process and start an instance:
      <?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_10loptd" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.3">
        <bpmn:process id="PROCESS" name="PROCESS" isExecutable="true" camunda:versionTag="1">
          <bpmn:startEvent id="StartEvent_1">
            <bpmn:outgoing>Flow_02ufvr1</bpmn:outgoing>
          </bpmn:startEvent>
          <bpmn:sequenceFlow id="Flow_02ufvr1" sourceRef="StartEvent_1" targetRef="Activity_1yhizlk" />
          <bpmn:serviceTask id="Activity_1yhizlk" name="TOPIC" camunda:type="external" camunda:topic="TOPIC">
            <bpmn:incoming>Flow_02ufvr1</bpmn:incoming>
            <bpmn:outgoing>Flow_0ucm82i</bpmn:outgoing>
          </bpmn:serviceTask>
          <bpmn:endEvent id="Event_0bl6e1j">
            <bpmn:incoming>Flow_0ucm82i</bpmn:incoming>
          </bpmn:endEvent>
          <bpmn:sequenceFlow id="Flow_0ucm82i" sourceRef="Activity_1yhizlk" targetRef="Event_0bl6e1j" />
        </bpmn:process>
        <bpmndi:BPMNDiagram id="BPMNDiagram_1">
          <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="PROCESS">
            <bpmndi:BPMNEdge id="Flow_02ufvr1_di" bpmnElement="Flow_02ufvr1">
              <di:waypoint x="215" y="117" />
              <di:waypoint x="270" y="117" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge id="Flow_0ucm82i_di" bpmnElement="Flow_0ucm82i">
              <di:waypoint x="370" y="117" />
              <di:waypoint x="432" y="117" />
            </bpmndi:BPMNEdge>
            <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_1mssexe_di" bpmnElement="Activity_1yhizlk">
              <dc:Bounds x="270" y="77" width="100" height="80" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="Event_0bl6e1j_di" bpmnElement="Event_0bl6e1j">
              <dc:Bounds x="432" y="99" width="36" height="36" />
            </bpmndi:BPMNShape>
          </bpmndi:BPMNPlane>
        </bpmndi:BPMNDiagram>
      </bpmn:definitions> 
      1. Call the fetch-and-lock endpoint with the following JSON body (please note the different keys in the topic definitions):
      {
         "workerId": "itsmemario",
         "maxTasks": 1,
         "topics": [
            {
               "topicName": "TOPIC",
               "lockDuration": 100,
               "processDefinitionKey": "PROCESS"
            },
            {
               "topicName": "TOPIC",
               "lockDuration": 100,
               "processDefinitionKey": "PROCESS2"
            }
         ]
      }

      Observed Behavior:

      HTTP response contains no external tasks.

      Expected behavior:

      I would expect the API to return external tasks that match any of the topic definitions, similarly to the way topicName works: the API will return tasks that match any of the topic names, defined in multiple topic definitions.

      When supplying the same key ("PROCESS") for the topics, tasks are returned properly.

      There are multiple fields that seem to be affected by this issue, including:

      • processDefinitionKey
      • processDefinitionKeyIn
      • processDefinitionId
      • processDefinitionIdIn
      • processDefinitionVersionTag

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              tassilo.weidner Tassilo Weidner
              bnagybalint Bálint Nagy
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Salesforce