``` <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" id="Definitions_1" targetNamespace="http://example.com/bpmn"> <bpmn:process id="Process_ImportOrders" name="Import Orders from Marketplace to ERP" isExecutable="true"> <bpmn:startEvent id="StartEvent_Timer" name="Every 10 minutes"> <bpmn:outgoing>Flow1</bpmn:outgoing> <bpmn:timerEventDefinition> <bpmn:timeCycle xsi:type="bpmn:tFormalExpression">PT10M</bpmn:timeCycle> </bpmn:timerEventDefinition> </bpmn:startEvent> <bpmn:task id="Task_CollectOrders" name="Collect all orders from marketplace"> <bpmn:incoming>Flow1</bpmn:incoming> <bpmn:outgoing>Flow2</bpmn:outgoing> </bpmn:task> <bpmn:subProcess id="SubProcess_ProcessOrders" name="Process Order" triggeredByEvent="false"> <bpmn:multiInstanceLoopCharacteristics isSequential="false" /> <bpmn:startEvent id="SubStart" name="New single order"> <bpmn:outgoing>Flow3</bpmn:outgoing> </bpmn:startEvent> <bpmn:task id="Task_CheckOrder" name="Check order data"> <bpmn:incoming>Flow3</bpmn:incoming> <bpmn:outgoing>Flow4</bpmn:outgoing> </bpmn:task> <bpmn:exclusiveGateway id="Gateway_DataCorrect" name="Data correct?"> <bpmn:incoming>Flow4</bpmn:incoming> <bpmn:outgoing>Flow5</bpmn:outgoing> <bpmn:outgoing>Flow6</bpmn:outgoing> </bpmn:exclusiveGateway> <bpmn:task id="Task_ImportOrder" name="Import order to ERP system"> <bpmn:incoming>Flow5</bpmn:incoming> <bpmn:outgoing>Flow7</bpmn:outgoing> </bpmn:task> <bpmn:endEvent id="End_Success" name="Single order processed"> <bpmn:incoming>Flow7</bpmn:incoming> </bpmn:endEvent> <bpmn:endEvent id="End_Failure" name="Order data incorrect"> <bpmn:incoming>Flow6</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="Flow3" sourceRef="SubStart" targetRef="Task_CheckOrder"/> <bpmn:sequenceFlow id="Flow4" sourceRef="Task_CheckOrder" targetRef="Gateway_DataCorrect"/> <bpmn:sequenceFlow id="Flow5" sourceRef="Gateway_DataCorrect" targetRef="Task_ImportOrder" name="yes"/> <bpmn:sequenceFlow id="Flow6" sourceRef="Gateway_DataCorrect" targetRef="End_Failure" name="no"/> <bpmn:sequenceFlow id="Flow7" sourceRef="Task_ImportOrder" targetRef="End_Success"/> </bpmn:subProcess> <bpmn:sequenceFlow id="Flow1" sourceRef="StartEvent_Timer" targetRef="Task_CollectOrders"/> <bpmn:sequenceFlow id="Flow2" sourceRef="Task_CollectOrders" targetRef="SubProcess_ProcessOrders"/> <bpmn:endEvent id="End_AllProcessed" name="All orders processed"> <bpmn:incoming>Flow8</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="Flow8" sourceRef="SubProcess_ProcessOrders" targetRef="End_AllProcessed"/> </bpmn:process> <!-- Diagram Interchange --> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_ImportOrders"> <bpmndi:BPMNShape id="StartEvent_Timer_di" bpmnElement="StartEvent_Timer"> <dc:Bounds x="100" y="100" width="36" height="36"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Task_CollectOrders_di" bpmnElement="Task_CollectOrders"> <dc:Bounds x="200" y="80" width="150" height="80"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SubProcess_ProcessOrders_di" bpmnElement="SubProcess_ProcessOrders" isExpanded="true"> <dc:Bounds x="400" y="40" width="600" height="220"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="End_AllProcessed_di" bpmnElement="End_AllProcessed"> <dc:Bounds x="1050" y="100" width="36" height="36"/> </bpmndi:BPMNShape> <!-- Inside Sub-Process --> <bpmndi:BPMNShape id="SubStart_di" bpmnElement="SubStart"> <dc:Bounds x="420" y="60" width="36" height="36"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Task_CheckOrder_di" bpmnElement="Task_CheckOrder"> <dc:Bounds x="480" y="50" width="140" height="56"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Gateway_DataCorrect_di" bpmnElement="Gateway_DataCorrect"> <dc:Bounds x="640" y="60" width="50" height="50"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Task_ImportOrder_di" bpmnElement="Task_ImportOrder"> <dc:Bounds x="720" y="50" width="160" height="56"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="End_Success_di" bpmnElement="End_Success"> <dc:Bounds x="900" y="60" width="36" height="36"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="End_Failure_di" bpmnElement="End_Failure"> <dc:Bounds x="720" y="140" width="36" height="36"/> </bpmndi:BPMNShape> <!-- Flows --> <bpmndi:BPMNEdge id="Flow1_di" bpmnElement="Flow1"> <di:waypoint x="136" y="118" /> <di:waypoint x="200" y="118" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow2_di" bpmnElement="Flow2"> <di:waypoint x="350" y="118" /> <di:waypoint x="400" y="118" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow8_di" bpmnElement="Flow8"> <di:waypoint x="1000" y="118" /> <di:waypoint x="1050" y="118" /> </bpmndi:BPMNEdge> <!-- Subprocess internal flows --> <bpmndi:BPMNEdge id="Flow3_di" bpmnElement="Flow3"> <di:waypoint x="456" y="78"/> <di:waypoint x="480" y="78"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow4_di" bpmnElement="Flow4"> <di:waypoint x="620" y="78"/> <di:waypoint x="640" y="78"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow5_di" bpmnElement="Flow5"> <di:waypoint x="690" y="78"/> <di:waypoint x="720" y="78"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow6_di" bpmnElement="Flow6"> <di:waypoint x="665" y="110"/> <di:waypoint x="738" y="140"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow7_di" bpmnElement="Flow7"> <di:waypoint x="880" y="78"/> <di:waypoint x="900" y="78"/> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> ```