Async cancel process

Look at the picture please.
When it is stopped on the stage number 1 I want to start step number 2 (by calling correlated message) which should cancel whole process.
Unfortunately when the process stops at stage number 1 the stage number 2 is dead. It is not listening.
How to achieve expected behaviour?

Change it to an interrupting start message event instead of a task.

1 Like

Then I get error

Caused by: org.camunda.bpm.engine.ParseException: ENGINE-09005 Could not parse BPMN process. Errors:

  • multiple start events not supported for subprocess | resource
  • messageEventDefinition only allowed on start event if subprocess is an event subprocess

Please upload your model

<?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_14i3j0u" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1">
  <bpmn:process id="Process_01t0g5c" name="my-process" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:outgoing>Flow_0oe3y79</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:subProcess id="Activity_1qzcq5n">
      <bpmn:incoming>Flow_0oe3y79</bpmn:incoming>
      <bpmn:outgoing>Flow_0wtgl8d</bpmn:outgoing>
      <bpmn:startEvent id="Event_0dxfbsp">
        <bpmn:outgoing>Flow_1qscd0o</bpmn:outgoing>
      </bpmn:startEvent>
      <bpmn:sequenceFlow id="Flow_1qscd0o" sourceRef="Event_0dxfbsp" targetRef="Activity_14d3u3j" />
      <bpmn:endEvent id="Event_1el9c4k">
        <bpmn:incoming>Flow_1o36ee8</bpmn:incoming>
      </bpmn:endEvent>
      <bpmn:sequenceFlow id="Flow_1o36ee8" sourceRef="Activity_14d3u3j" targetRef="Event_1el9c4k" />
      <bpmn:receiveTask id="Activity_14d3u3j" messageRef="Message_0epor8w">
        <bpmn:incoming>Flow_1qscd0o</bpmn:incoming>
        <bpmn:outgoing>Flow_1o36ee8</bpmn:outgoing>
      </bpmn:receiveTask>
      <bpmn:sequenceFlow id="Flow_1rhdd3t" sourceRef="Event_08sqi0t" targetRef="Event_0ycbdfw" />
      <bpmn:endEvent id="Event_0ycbdfw">
        <bpmn:incoming>Flow_1rhdd3t</bpmn:incoming>
        <bpmn:errorEventDefinition id="ErrorEventDefinition_1w4ty3x" errorRef="Error_08u6ky3" />
      </bpmn:endEvent>
      <bpmn:startEvent id="Event_08sqi0t" camunda:asyncBefore="true">
        <bpmn:outgoing>Flow_1rhdd3t</bpmn:outgoing>
        <bpmn:messageEventDefinition id="MessageEventDefinition_1dhywmd" messageRef="Message_0f7k2m7" />
      </bpmn:startEvent>
    </bpmn:subProcess>
    <bpmn:sequenceFlow id="Flow_0oe3y79" sourceRef="StartEvent_1" targetRef="Activity_1qzcq5n" />
    <bpmn:endEvent id="Event_15te5vh">
      <bpmn:incoming>Flow_0wtgl8d</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_0wtgl8d" sourceRef="Activity_1qzcq5n" targetRef="Event_15te5vh" />
    <bpmn:endEvent id="Event_05crkmq">
      <bpmn:incoming>Flow_0vqxd0k</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_0vqxd0k" sourceRef="Event_0if5q6c" targetRef="Event_05crkmq" />
    <bpmn:boundaryEvent id="Event_0if5q6c" attachedToRef="Activity_1qzcq5n">
      <bpmn:outgoing>Flow_0vqxd0k</bpmn:outgoing>
      <bpmn:errorEventDefinition id="ErrorEventDefinition_00gqhz9" errorRef="Error_08u6ky3" />
    </bpmn:boundaryEvent>
  </bpmn:process>
  <bpmn:message id="Message_0f7k2m7" name="msg-stop-process" />
  <bpmn:message id="Message_0epor8w" name="msg-go" />
  <bpmn:error id="Error_08u6ky3" name="myerror" errorCode="myerror" camunda:errorMessage="myerror" />
  <bpmn:error id="Error_18tg376" name="Error_3ev5jb3" />
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_01t0g5c">
      <bpmndi:BPMNEdge id="Flow_0oe3y79_di" bpmnElement="Flow_0oe3y79">
        <di:waypoint x="188" y="177" />
        <di:waypoint x="300" y="177" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0wtgl8d_di" bpmnElement="Flow_0wtgl8d">
        <di:waypoint x="680" y="170" />
        <di:waypoint x="802" y="170" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0vqxd0k_di" bpmnElement="Flow_0vqxd0k">
        <di:waypoint x="698" y="300" />
        <di:waypoint x="802" y="300" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Event_15te5vh_di" bpmnElement="Event_15te5vh">
        <dc:Bounds x="802" y="152" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="152" y="159" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_05crkmq_di" bpmnElement="Event_05crkmq">
        <dc:Bounds x="802" y="282" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1qzcq5n_di" bpmnElement="Activity_1qzcq5n" isExpanded="true">
        <dc:Bounds x="300" y="77" width="380" height="323" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_1qscd0o_di" bpmnElement="Flow_1qscd0o">
        <di:waypoint x="376" y="177" />
        <di:waypoint x="430" y="177" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1o36ee8_di" bpmnElement="Flow_1o36ee8">
        <di:waypoint x="530" y="177" />
        <di:waypoint x="592" y="177" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1rhdd3t_di" bpmnElement="Flow_1rhdd3t">
        <di:waypoint x="376" y="300" />
        <di:waypoint x="592" y="300" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Event_0dxfbsp_di" bpmnElement="Event_0dxfbsp">
        <dc:Bounds x="340" y="159" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1el9c4k_di" bpmnElement="Event_1el9c4k">
        <dc:Bounds x="592" y="159" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0yx78w8_di" bpmnElement="Activity_14d3u3j">
        <dc:Bounds x="430" y="137" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0jd5tz3_di" bpmnElement="Event_0ycbdfw">
        <dc:Bounds x="592" y="282" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_077qlbz_di" bpmnElement="Event_08sqi0t">
        <dc:Bounds x="340" y="282" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1sh0qi0_di" bpmnElement="Event_0if5q6c">
        <dc:Bounds x="662" y="282" width="36" height="36" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

I seems that you’re lacking some understanding of some of these advanced symbols.
I’d suggest that you spend some time learning about some of the advanced symbols and Patterns. in the BPMN 2.0 standard.
You’re looking to implement something that looks like this:

diagram_4.bpmn (6.1 KB)

1 Like

how this rectangle is called? How to create it? I can’t see such element…

It’s called an Event Subprocess.

It can be a little hard to figure out how to create it so see the below gif.

1 Like