Mastering BPMN AND Gateways: Orchestrating Supplier Reviews with VPasCode

Mastering BPMN AND Gateways: Orchestrating Supplier Reviews with VPasCode

In Business Process Model and Notation (BPMN), the accurate representation of process flow is critical for operational efficiency. One of the most common misconceptions in process modeling is the misuse of gateways. Specifically, the AND gateway (Parallel Gateway) is often used simply to split a flow where multiple paths exist, rather than to enforce strict synchronization.

This tutorial explores a robust supplier onboarding scenario where two independent but mandatory checks—Compliance and Financial reviews—must occur. We will analyze the system architecture using BPMN standards, demonstrate how to model this logic using VPasCode, and discuss the integration of Decision Management Models (DMN).

Understanding the Parallel Gateway Logic

The diagram illustrates a process where a single input triggers a mandatory parallel sequence. This is the textbook definition of the AND gateway behavior. Unlike an XOR (Exclusive) gateway, which represents a choice where only one path is taken, an AND gateway requires that all outgoing paths are triggered.

1. The Split: Initiating Parallel Workflows

The process begins when a supplier application is received. Immediately following this task, the flow hits a Parallel Gateway (marked with a +). This gateway performs a split operation. It does not choose between the “Compliance review” and the “Financial review”; instead, it sends the process token down both paths simultaneously.

In a real-world context, this allows the Compliance team to begin verifying licenses while the Finance team simultaneously audits bank statements. Because these tasks are independent, doing them in parallel significantly reduces the overall cycle time compared to doing them sequentially.

2. The Join: Synchronizing Convergence

Once both the Compliance and Financial reviews are complete, the process flow must converge before the final decision can be made. The second AND gateway acts as a join.

Crucial Rule: The AND gateway will not allow the flow to proceed to the “Make approval decision” task until tokens have arrived on both incoming paths. If the Financial review is fast but the Compliance review takes a week, the process waits at the join gateway until the Compliance review is finished. This ensures that no approval is made without all necessary data.

Implementing the Architecture with VPasCode

Visual Paradigm’s VPasCode allows developers to define BPMN models using a text-based syntax, which is often faster than dragging and dropping shapes and easier to version control. The following code snippet demonstrates how to programmatically construct the “Supplier Application Review” model shown above.


// Define the Process
process "Supplier Application Review" {
    
    // Define Start and End Events
    startEvent "Start"
    endEvent "End"
    
    // Define Tasks
    task "Receive supplier application"
    task "Compliance review"
    task "Financial review"
    task "Make approval decision"
    
    // Define Gateways (AND Gateways)
    parallelGateway "Split Gateway"
    parallelGateway "Join Gateway"
    
    // Connect the Flow
    startEvent -> "Receive supplier application"
    "Receive supplier application" -> "Split Gateway"
    
    // Parallel Split: Both paths are triggered
    "Split Gateway" -> "Compliance review"
    "Split Gateway" -> "Financial review"
    
    // Parallel Join: Wait for both to complete
    "Compliance review" -> "Join Gateway"
    "Financial review" -> "Join Gateway"
    
    // Final Decision Step
    "Join Gateway" -> "Make approval decision"
    "Make approval decision" -> endEvent
    
    // Annotation for DMN integration
    annotation "For complex policy, invoke a DMN decision." -> "Make approval decision"
}

Technical Analysis of the Code

  • parallelGateway: In the code, we explicitly instantiate the gateway. In the visual model, this renders as the diamond shape with a + sign.
  • Annotation: The dashed line connecting the “Make approval decision” task to the DMN note is handled via the annotation command, linking the logic to external decision policies.

Integrating DMN for Complex Policies

The final step in the diagram, “Make approval decision,” is often a simplified representation of a Decision Model and Notation (DMN) invocation. In modern enterprise architecture, we separate the Process (the flow of work) from the Decision (the logic of approval).

When the flow reaches the join gateway, the process engine pauses the specific instance and calls the DMN engine. The DMN engine evaluates rules such as: “Is credit score > 650?” and “Has background check passed?”. The DMN engine returns a result (Approve/Reject) to the BPMN engine, which then routes the process to the End event or sends a rejection email.

Conclusion

By correctly utilizing the AND gateway, the “Supplier Application Review” process ensures data integrity and parallel efficiency. The process cannot move forward to an approval stage until both the Compliance and Financial reviews are physically complete. This synchronization is vital for risk management in supply chain operations.