<?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_rejected_at_initiation" targetNamespace="https://www.analystengineering.com/iso-20022/payment-process-bpmn" exporter="Analyst Engineering" exporterVersion="1.0">
  <bpmn:collaboration id="Collaboration_1">
    <bpmn:documentation>Rejected by the debtor bank: FF01, AM05, AM04. The debtor agent runs three gates before any money moves: schema validation (failure is pain.002 RJCT FF01, often for the whole file), duplicate detection (RJCT AM05) and the funds check (RJCT AM04). Each rejection ends the process at the front door. Source: https://www.analystengineering.com/iso-20022/payment-process-bpmn#rejected-at-initiation</bpmn:documentation>
    <bpmn:participant id="Participant_debtor" name="Debtor (customer who pays)" />
    <bpmn:participant id="Participant_dbtr" name="Debtor agent (debtor bank)" processRef="Process_dbtr" />
    <bpmn:messageFlow id="Message_1" name="pain.001" sourceRef="Participant_debtor" targetRef="Node_a0" />
    <bpmn:messageFlow id="Message_2" name="pain.002 RJCT FF01" sourceRef="Node_a3" targetRef="Participant_debtor" />
    <bpmn:messageFlow id="Message_3" name="pain.002 RJCT AM05" sourceRef="Node_a6" targetRef="Participant_debtor" />
    <bpmn:messageFlow id="Message_4" name="pain.002 RJCT AM04" sourceRef="Node_a9" targetRef="Participant_debtor" />
  </bpmn:collaboration>
  <bpmn:process id="Process_dbtr" name="Debtor agent (debtor bank)" isExecutable="false">
    <bpmn:startEvent id="Node_a0" name="pain.001 received">
      <bpmn:outgoing>Flow_1</bpmn:outgoing>
      <bpmn:messageEventDefinition id="Node_a0_def" />
    </bpmn:startEvent>
    <bpmn:serviceTask id="Node_a1" name="Validate schema and rules">
      <bpmn:incoming>Flow_1</bpmn:incoming>
      <bpmn:outgoing>Flow_2</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="Node_a2" name="Valid?">
      <bpmn:incoming>Flow_2</bpmn:incoming>
      <bpmn:outgoing>Flow_3</bpmn:outgoing>
      <bpmn:outgoing>Flow_4</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:endEvent id="Node_a3" name="Reject file">
      <bpmn:incoming>Flow_3</bpmn:incoming>
      <bpmn:messageEventDefinition id="Node_a3_def" />
    </bpmn:endEvent>
    <bpmn:serviceTask id="Node_a4" name="Duplicate check">
      <bpmn:incoming>Flow_4</bpmn:incoming>
      <bpmn:outgoing>Flow_5</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="Node_a5" name="Duplicate?">
      <bpmn:incoming>Flow_5</bpmn:incoming>
      <bpmn:outgoing>Flow_6</bpmn:outgoing>
      <bpmn:outgoing>Flow_7</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:endEvent id="Node_a6" name="Reject payment">
      <bpmn:incoming>Flow_6</bpmn:incoming>
      <bpmn:messageEventDefinition id="Node_a6_def" />
    </bpmn:endEvent>
    <bpmn:serviceTask id="Node_a7" name="Check available funds">
      <bpmn:incoming>Flow_7</bpmn:incoming>
      <bpmn:outgoing>Flow_8</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="Node_a8" name="Funds available?">
      <bpmn:incoming>Flow_8</bpmn:incoming>
      <bpmn:outgoing>Flow_9</bpmn:outgoing>
      <bpmn:outgoing>Flow_10</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:endEvent id="Node_a9" name="Reject payment">
      <bpmn:incoming>Flow_9</bpmn:incoming>
      <bpmn:messageEventDefinition id="Node_a9_def" />
    </bpmn:endEvent>
    <bpmn:callActivity id="Node_a10" name="Execute payment (scenario 1)">
      <bpmn:incoming>Flow_10</bpmn:incoming>
      <bpmn:outgoing>Flow_11</bpmn:outgoing>
    </bpmn:callActivity>
    <bpmn:endEvent id="Node_a11" name="Executed">
      <bpmn:incoming>Flow_11</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_1" sourceRef="Node_a0" targetRef="Node_a1" />
    <bpmn:sequenceFlow id="Flow_2" sourceRef="Node_a1" targetRef="Node_a2" />
    <bpmn:sequenceFlow id="Flow_3" name="No" sourceRef="Node_a2" targetRef="Node_a3" />
    <bpmn:sequenceFlow id="Flow_4" name="Yes" sourceRef="Node_a2" targetRef="Node_a4" />
    <bpmn:sequenceFlow id="Flow_5" sourceRef="Node_a4" targetRef="Node_a5" />
    <bpmn:sequenceFlow id="Flow_6" name="Yes" sourceRef="Node_a5" targetRef="Node_a6" />
    <bpmn:sequenceFlow id="Flow_7" name="No" sourceRef="Node_a5" targetRef="Node_a7" />
    <bpmn:sequenceFlow id="Flow_8" sourceRef="Node_a7" targetRef="Node_a8" />
    <bpmn:sequenceFlow id="Flow_9" name="No" sourceRef="Node_a8" targetRef="Node_a9" />
    <bpmn:sequenceFlow id="Flow_10" name="Yes" sourceRef="Node_a8" targetRef="Node_a10" />
    <bpmn:sequenceFlow id="Flow_11" sourceRef="Node_a10" targetRef="Node_a11" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1" name="Rejected by the debtor bank: FF01, AM05, AM04">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1">
      <bpmndi:BPMNShape id="Participant_debtor_di" bpmnElement="Participant_debtor" isHorizontal="true"><dc:Bounds x="8" y="8" width="1258" height="52" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Participant_dbtr_di" bpmnElement="Participant_dbtr" isHorizontal="true"><dc:Bounds x="8" y="124" width="1258" height="228" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a0_di" bpmnElement="Node_a0"><dc:Bounds x="98" y="272" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="66" y="312" width="100" height="13" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a1_di" bpmnElement="Node_a1"><dc:Bounds x="190" y="254" width="100" height="72" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a2_di" bpmnElement="Node_a2" isMarkerVisible="true"><dc:Bounds x="339" y="265" width="50" height="50" /><bpmndi:BPMNLabel><dc:Bounds x="314" y="319" width="100" height="13" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a3_di" bpmnElement="Node_a3"><dc:Bounds x="470" y="168" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="438" y="208" width="100" height="13" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a4_di" bpmnElement="Node_a4"><dc:Bounds x="438" y="254" width="100" height="72" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a5_di" bpmnElement="Node_a5" isMarkerVisible="true"><dc:Bounds x="587" y="265" width="50" height="50" /><bpmndi:BPMNLabel><dc:Bounds x="562" y="319" width="100" height="13" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a6_di" bpmnElement="Node_a6"><dc:Bounds x="718" y="168" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="686" y="208" width="100" height="13" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a7_di" bpmnElement="Node_a7"><dc:Bounds x="686" y="254" width="100" height="72" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a8_di" bpmnElement="Node_a8" isMarkerVisible="true"><dc:Bounds x="835" y="265" width="50" height="50" /><bpmndi:BPMNLabel><dc:Bounds x="810" y="319" width="100" height="13" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a9_di" bpmnElement="Node_a9"><dc:Bounds x="966" y="168" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="934" y="208" width="100" height="13" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a10_di" bpmnElement="Node_a10"><dc:Bounds x="934" y="254" width="100" height="72" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Node_a11_di" bpmnElement="Node_a11"><dc:Bounds x="1090" y="272" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="1058" y="312" width="100" height="13" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_1_di" bpmnElement="Flow_1"><di:waypoint x="134" y="290" /><di:waypoint x="190" y="290" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_2_di" bpmnElement="Flow_2"><di:waypoint x="290" y="290" /><di:waypoint x="339" y="290" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_3_di" bpmnElement="Flow_3"><di:waypoint x="364" y="265" /><di:waypoint x="364" y="186" /><di:waypoint x="470" y="186" /><bpmndi:BPMNLabel><dc:Bounds x="370" y="246" width="60" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_4_di" bpmnElement="Flow_4"><di:waypoint x="389" y="290" /><di:waypoint x="438" y="290" /><bpmndi:BPMNLabel><dc:Bounds x="395" y="273" width="60" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_5_di" bpmnElement="Flow_5"><di:waypoint x="538" y="290" /><di:waypoint x="587" y="290" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_6_di" bpmnElement="Flow_6"><di:waypoint x="612" y="265" /><di:waypoint x="612" y="186" /><di:waypoint x="718" y="186" /><bpmndi:BPMNLabel><dc:Bounds x="618" y="246" width="60" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_7_di" bpmnElement="Flow_7"><di:waypoint x="637" y="290" /><di:waypoint x="686" y="290" /><bpmndi:BPMNLabel><dc:Bounds x="643" y="273" width="60" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_8_di" bpmnElement="Flow_8"><di:waypoint x="786" y="290" /><di:waypoint x="835" y="290" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_9_di" bpmnElement="Flow_9"><di:waypoint x="860" y="265" /><di:waypoint x="860" y="186" /><di:waypoint x="966" y="186" /><bpmndi:BPMNLabel><dc:Bounds x="866" y="246" width="60" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_10_di" bpmnElement="Flow_10"><di:waypoint x="885" y="290" /><di:waypoint x="934" y="290" /><bpmndi:BPMNLabel><dc:Bounds x="891" y="273" width="60" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_11_di" bpmnElement="Flow_11"><di:waypoint x="1034" y="290" /><di:waypoint x="1090" y="290" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Message_1_di" bpmnElement="Message_1"><di:waypoint x="116" y="60" /><di:waypoint x="116" y="272" /><bpmndi:BPMNLabel><dc:Bounds x="123" y="78" width="96" height="28" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Message_2_di" bpmnElement="Message_2"><di:waypoint x="488" y="168" /><di:waypoint x="488" y="60" /><bpmndi:BPMNLabel><dc:Bounds x="495" y="78" width="96" height="28" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Message_3_di" bpmnElement="Message_3"><di:waypoint x="736" y="168" /><di:waypoint x="736" y="60" /><bpmndi:BPMNLabel><dc:Bounds x="743" y="78" width="96" height="28" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Message_4_di" bpmnElement="Message_4"><di:waypoint x="984" y="168" /><di:waypoint x="984" y="60" /><bpmndi:BPMNLabel><dc:Bounds x="991" y="78" width="96" height="28" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
