Somehow getting 2 Tokens after Exclusive Gateway

This is really baffling, we have a situation in an HR process where we have only a single token at the “Conduct CEO Interview” User Task, but after that task is completed we all of the sudden have 2 tokens and we are not sure why.

I understand a Parallel Gateway will cause multiple tokens, but I did not know an exclusive could create multiple tokens.

The Script Task in between the Gateway and Next User Task where the 2 tokens show up are only HTTP Connector Tasks to update the database.

Does anyone have any ideas why we are getting 2 tokens?

Thanks

image

1 Like

Can you upload the mode itself so i can take a look at technical details?

Here is the flow minus the API calls for security reasons.

<?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:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1q0she7" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.4.0">
  <bpmn:process id="Process_1me2jgq" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:outgoing>Flow_0m1dvqc</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:userTask id="Activity_0c0858z" name="Need Client Interview" camunda:assignee="ashleyn" camunda:dueDate="${dateTime().plusDays(1).toDate()}" camunda:priority="5">
      <bpmn:extensionElements>
        <camunda:formData>
          <camunda:formField id="need_client_interview" label="Need Client Interview?" type="enum" defaultValue="No">
            <camunda:validation>
              <camunda:constraint name="required" />
            </camunda:validation>
            <camunda:value id="need_client_interview_yes" name="Yes" />
            <camunda:value id="need_client_interview_no" name="No" />
          </camunda:formField>
        </camunda:formData>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0fx8h5q</bpmn:incoming>
      <bpmn:outgoing>Flow_1orlptc</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:userTask id="Activity_0kuhdpq" name="Conduct Interview with CEO" camunda:assignee="austinp" camunda:candidateGroups="hiring" camunda:dueDate="${dateTime().plusDays(3).toDate()}" camunda:priority="5">
      <bpmn:extensionElements>
        <camunda:formData>
          <camunda:formField id="candidate_accepted" label="Candidate Accepted?" type="enum">
            <camunda:validation>
              <camunda:constraint name="required" />
            </camunda:validation>
            <camunda:value id="candidate_accepted_yes" name="Yes" />
            <camunda:value id="candidate_accepted_no" name="No" />
          </camunda:formField>
          <camunda:formField id="ceo_interview_comments" label="Comments" type="string">
            <camunda:validation>
              <camunda:constraint name="required" />
            </camunda:validation>
          </camunda:formField>
          <camunda:formField id="hour_per_week_commitment" label="Hours per Week?" type="long">
            <camunda:validation>
              <camunda:constraint name="required" />
            </camunda:validation>
          </camunda:formField>
          <camunda:formField id="what_are_you_looking_for" label="Looking for?" type="enum">
            <camunda:validation>
              <camunda:constraint name="required" />
            </camunda:validation>
            <camunda:value id="what_are_you_looking_for_fulltime" name="Full-Time" />
            <camunda:value id="what_are_you_looking_for_partime" name="Part-Time" />
          </camunda:formField>
        </camunda:formData>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0m1dvqc</bpmn:incoming>
      <bpmn:outgoing>Flow_0o1d1j1</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:exclusiveGateway id="Gateway_1og2kv4" name="Accept Candiate" default="Flow_0fx8h5q">
      <bpmn:incoming>Flow_0o1d1j1</bpmn:incoming>
      <bpmn:outgoing>Flow_0fx8h5q</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:sequenceFlow id="Flow_0o1d1j1" sourceRef="Activity_0kuhdpq" targetRef="Gateway_1og2kv4" />
    <bpmn:sequenceFlow id="Flow_0fx8h5q" name="Yes" sourceRef="Gateway_1og2kv4" targetRef="Activity_0c0858z" />
    <bpmn:sequenceFlow id="Flow_0m1dvqc" sourceRef="StartEvent_1" targetRef="Activity_0kuhdpq" />
    <bpmn:endEvent id="Event_0psg6p2">
      <bpmn:incoming>Flow_1orlptc</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_1orlptc" sourceRef="Activity_0c0858z" targetRef="Event_0psg6p2" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1me2jgq">
      <bpmndi:BPMNEdge id="Flow_0o1d1j1_di" bpmnElement="Flow_0o1d1j1" bioc:stroke="rgb(67, 160, 71)" bioc:fill="rgb(200, 230, 201)">
        <di:waypoint x="356" y="120" />
        <di:waypoint x="465" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0fx8h5q_di" bpmnElement="Flow_0fx8h5q" bioc:stroke="rgb(67, 160, 71)" bioc:fill="rgb(200, 230, 201)">
        <di:waypoint x="515" y="120" />
        <di:waypoint x="600" y="120" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="562" y="95" width="18" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0m1dvqc_di" bpmnElement="Flow_0m1dvqc">
        <di:waypoint x="188" y="120" />
        <di:waypoint x="256" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1orlptc_di" bpmnElement="Flow_1orlptc">
        <di:waypoint x="700" y="120" />
        <di:waypoint x="792" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Activity_0kuhdpq_di" bpmnElement="Activity_0kuhdpq" bioc:stroke="rgb(229, 57, 53)" bioc:fill="rgb(255, 205, 210)">
        <dc:Bounds x="256" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="152" y="102" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Gateway_1og2kv4_di" bpmnElement="Gateway_1og2kv4" isMarkerVisible="true" bioc:stroke="rgb(67, 160, 71)" bioc:fill="rgb(200, 230, 201)">
        <dc:Bounds x="465" y="95" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="449" y="71" width="81" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0c0858z_di" bpmnElement="Activity_0c0858z" bioc:stroke="rgb(229, 57, 53)" bioc:fill="rgb(255, 205, 210)">
        <dc:Bounds x="600" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0psg6p2_di" bpmnElement="Event_0psg6p2">
        <dc:Bounds x="792" y="102" width="36" height="36" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

Does the error also occur in this model?
If not - can you send me a model that you can show where the error occurs.

Did you already check if maybe have 2 outgoing flows from one to another activity?

If you have, then Camunda will create a token for each flow, even if the source- and target activity of these flows are the same, this results into 2 tokens at the target activity.

1 Like