Skip to content

Instantly share code, notes, and snippets.

@Njurus
Last active July 4, 2025 22:27
Show Gist options
  • Save Njurus/d65a402fc40c3f9761e9c10465aca22b to your computer and use it in GitHub Desktop.
Save Njurus/d65a402fc40c3f9761e9c10465aca22b to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
id="Definitions_Checkout"
targetNamespace="http://tovuty.co.ke/bpmn">
<process id="MobileFirst_Checkout_Process" name="Mobile-first Checkout Process" isExecutable="true">
<laneSet id="LaneSet_Checkout">
<lane id="Lane_Customer" name="Customer"/>
<lane id="Lane_Frontend" name="WordPress PWA Frontend"/>
<lane id="Lane_WooCommerce" name="WooCommerce Backend"/>
<lane id="Lane_MpesaAPI" name="M-PESA API"/>
</laneSet>
<startEvent id="StartEvent_CheckoutInitiated" name="Checkout Initiated"/>
<task id="Task_DisplayCheckoutForm" name="Display Checkout Form (Mobile-first PWA theme)"/>
<task id="Task_EnterMobileNumber" name="Enter Mobile Number"/>
<task id="Task_EnterShippingDetails" name="Enter Shipping Address"/>
<task id="Task_ReviewOrderSummary" name="Review Cart & Order Summary"/>
<task id="Task_ConfirmOrder" name="Confirm Order"/>
<task id="Task_InitiateSTKPush" name="Initiate M-PESA STK Push (WooCommerce Plugin)"/>
<intermediateCatchEvent id="IntermediateCatchEvent_PaymentResponse" name="Wait for M-PESA Confirmation">
<messageEventDefinition/>
</intermediateCatchEvent>
<exclusiveGateway id="Gateway_PaymentResult" name="Payment Successful?"/>
<task id="Task_GenerateOrder" name="Generate WooCommerce Order Record"/>
<task id="Task_SendConfirmation" name="Send Order Confirmation (Email/WhatsApp)"/>
<endEvent id="EndEvent_OrderConfirmed" name="Order Confirmed"/>
<task id="Task_NotifyFailure" name="Notify Payment Failure"/>
<exclusiveGateway id="Gateway_RetryPayment" name="Retry Payment?"/>
<endEvent id="EndEvent_CheckoutCancelled" name="Checkout Cancelled"/>
<!-- Sequence Flows -->
<sequenceFlow id="Flow_1" sourceRef="StartEvent_CheckoutInitiated" targetRef="Task_DisplayCheckoutForm"/>
<sequenceFlow id="Flow_2" sourceRef="Task_DisplayCheckoutForm" targetRef="Task_EnterMobileNumber"/>
<sequenceFlow id="Flow_3" sourceRef="Task_EnterMobileNumber" targetRef="Task_EnterShippingDetails"/>
<sequenceFlow id="Flow_4" sourceRef="Task_EnterShippingDetails" targetRef="Task_ReviewOrderSummary"/>
<sequenceFlow id="Flow_5" sourceRef="Task_ReviewOrderSummary" targetRef="Task_ConfirmOrder"/>
<sequenceFlow id="Flow_6" sourceRef="Task_ConfirmOrder" targetRef="Task_InitiateSTKPush"/>
<sequenceFlow id="Flow_7" sourceRef="Task_InitiateSTKPush" targetRef="IntermediateCatchEvent_PaymentResponse"/>
<sequenceFlow id="Flow_8" sourceRef="IntermediateCatchEvent_PaymentResponse" targetRef="Gateway_PaymentResult"/>
<sequenceFlow id="Flow_9" sourceRef="Gateway_PaymentResult" targetRef="Task_GenerateOrder">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${paymentSuccess}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="Flow_10" sourceRef="Task_GenerateOrder" targetRef="Task_SendConfirmation"/>
<sequenceFlow id="Flow_11" sourceRef="Task_SendConfirmation" targetRef="EndEvent_OrderConfirmed"/>
<sequenceFlow id="Flow_12" sourceRef="Gateway_PaymentResult" targetRef="Task_NotifyFailure">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!paymentSuccess}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="Flow_13" sourceRef="Task_NotifyFailure" targetRef="Gateway_RetryPayment"/>
<sequenceFlow id="Flow_14" sourceRef="Gateway_RetryPayment" targetRef="Task_InitiateSTKPush">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${retry}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="Flow_15" sourceRef="Gateway_RetryPayment" targetRef="EndEvent_CheckoutCancelled">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!retry}]]></conditionExpression>
</sequenceFlow>
</process>
</definitions>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment