Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Car Repair Process

This example simulates the process flow of a Car Repair shop. The BPSim configuration:

  • Uses a property parameter initialized by distribution to generate a random number of issues for each customer
  • Applies probability to simulate:
         -  Acceptance of the initial estimate or not
         -  Whether new issues will be found during repair
  • Increments or decrements the property parameter's value in each task
  • Uses the property parameter's value on conditions of Sequences outgoing from Gateways
  • Simulates the customer arrivals for a given start and duration

Create BPMN Model

Create the main process

Example Business Process diagram for simulation in Sparx Systems Enterprise Architect

  1. Create a Start Event Customer Arrives.
  2. Add a Sequence Flow to a target abstract task Activity Make Estimate.
  3. Add a Sequence Flow to a target Exclusive Gateway Accepted?.
  4. Add Sequence Flows to:
         -  A target End Event Initial Estimate Not Accepted
         -  A target subProcess Repair Car
  5. From Repair Car, add a Sequence Flow to a target abstract task Activity Accept Payment.
  6. Add a Sequence Flow to a target End Event Customer Leaves Shop.

Create the sub process Repair Car

Example Business Process diagram for simulation in Sparx Systems Enterprise Architect

  1. Create a Start Event Start Repairs.
  2. Add a Sequence Flow to a target Exclusive Gateway converge Gateway1.
  3. Add a Sequence Flow to an abstract task Activity Inspect for Issue.
  4. Add a Sequence Flow to an Exclusive Gateway converge Gateway2.
  5. Add a Sequence Flow to an Exclusive Gateway New Issue Found?.
  6. Add Sequence Flows to:
         -  A target abstract task Activity Handle New Found Issue, then add a
            Sequence Flow back to converge Gateway2
         -  A target abstract task Repair Issue, then add a Sequence Flow to a
            target Exclusive Gateway Have further issues?
  7. From the Gateway Have further issues? add Sequence Flows to:
         -  The target End Event Repairs Completed
         -  converge Gateway1

Configure BPSim

Task

Description

Artifact and Package

  1. Open the Configure BPSim window ('Simulate > Process Analysis > BPSim > Open BPSim Manager').
  2. Create a Business Process Simulation Artifact named Scenario 1: Main flow.
  3. Select the Package containing the corresponding BPMN 2.0 model.

Start and Duration

We will simulate the processes in a car repair shop whose opening hours are from 9:00 am to 5:00 pm, which is a period of 8 hours. We also suppose that a customer walking in after 4:50 pm will not be served on that day. Therefore the simulation Start time is 9:00 am and the duration is 7 hours and 50 minutes.

On the 'Car Repair' diagram, click on the Business Process Simulation Artifact named Scenario 1: Main Flow and, on the Configure BPSim window, update these ScenarioParameters:

  • Start - overtype the 'Values' field with any date (in the format dd/mm/yyyy) and change the time section to '9:00 AM'
  • Duration - click on the Browse. button in the 'Values' field and set it to a Constant Duration of '0 07:50:00'

Customer Arrives

We will simulate a customer arriving every 24 minutes.

The first customer arrives at 9:00 AM and the last arrives at 4:36 PM (the customer arriving at 5:00 PM will not be served today because that is constrained by the 'Duration' setting).

With a pen and paper, we can calculate that there are 20 customers served (9:00 AM to 4:36 PM = 456 minutes; number of customers is 456/24 + 1 = 19 + 1 = 20). We will verify this with the simulation result later.

On the 'Car Repair' diagram, click on the Start Event element Customer Arrives, and in the Configure BPSim window:

  1. Click on the New Parameter drop-down arrow, and select 'Control'.
  2. Click on the 'Parameter' drop-down arrow and select 'InterTriggerTimer'.
  3. In the 'Values' field click on the Browse. button and set a Constant Numeric value of '24 minutes'. Click on the OK button and the Save toolbar icon.

Property Parameters

We suppose each customer's car might initially have a different number of issues. This could be reflected using a random number generator. BPSim provides a number of distributions to suit your needs.

In this example, we use a Truncated Normal distribution to initialize the property noOfIssues. Tasks Repair Issue and Handle New Found Issue will decrement and increment the value of noOfIssues respectively.

  1. On the 'Car Repair' diagram, click on the Start Event Customer Arrives.
  2. On the 'Configure' tab of the Configure BPSim window, click on the New Parameter drop-down arrow and create a Property parameter called noOfIssues.
  3. In the 'Values' field click on the Browse. button; the 'Configure 'noOfIssues' for 'CustomerArrives'' dialog displays.
  4. Click on the 'Distribution' tab and select 'TruncatedNormal'; in the fields:
         -  'Mean', type '2'
         -  'StandardDeviation', type '1'
         -  'Min', type '1'
         -  'Max', type '1000'

Important Note: Distributions such as 'TruncatedNormal', return a floating point value, but the property is used as an integer. Setting the property's type is important, especially in condition expressions when testing with equality. For example, the condition expression getProperty('noOfIssues') = 0 will almost never be satisfied because noOfIssues was initialized by a floating point distribution.

Tip: How to customize the type for a property

After you create the property and set a value, click on the icon on the toolbar, and then click on the icon to display the 'Edit Property Parameters' dialog. In the 'Type' field for the property, click on the drop-down arrow and select the value 'int' instead of the default 'double'.

  1. On the 'Repair Car' diagram, click on the Activity Repair Issue.
  2. On the 'Configure' tab of the Configure BPSim window, click on the New Parameter drop-down arrow and create a Property parameter called noOfIssues.
  3. In the 'Values' field click on the Browse. button. The 'Configure 'noOfIssues' for 'Repair Issue'' dialog displays.
  4. Click on the 'Expression' tab and, in the 'Expression' field, type {noOfIssues} -1; click on the OK button.
  5. On the 'Repair Car' diagram, click on the Activity Handle New Found Issue.
  6. On the 'Configure' tab of the Configure BPSim window, click on the New Parameter drop-down arrow and create a Property parameter called noOfIssues.
  7. In the 'Values' field click on the Browse. button. The 'Configure 'noOfIssues' for 'Handle New Found Issue'' dialog displays.
  8. Click on the 'Expression' tab and, in the 'Expression' field, type {noOfIssues} +1; click on the OK button.

Probability on Sequence Flows

We estimate that one in three of the customers will not accept the initial estimate for repairs and the remaining two will accept it. We also estimate that for one in four of the repairs new issues will be found, and for the remaining three repairs no new issues will be found.

On the 'Car Repair' diagram, refer to the Gateway element Accepted?. Click on the:

  • Initial Estimate Accepted Sequence Flow and in the Configure BPSim window click on the New Parameter drop-down arrow, and create a Control parameter called 'Probability'; in the 'Values' field type '0.67'
  • Initial Estimate Not Accepted Sequence Flow, and in the Configure BPSim window click on the New Parameter drop-down arrow, and create a Control parameter called 'Probability'; in the 'Values' field type '0.33'

On the 'Car Repair' diagram, refer to the Gateway element New Issue Found?. Click on the:

  • No More Issues to Repair Sequence Flow and in the Configure BPSim window click on the New Parameter drop-down arrow, and create a Control parameter called 'Probability'; in the 'Values' field type '0.75'
  • More Issues to Repair Sequence Flow and in the Configure BPSim window click on the New Parameter drop-down arrow, and create a Control parameter called 'Probability'; in the 'Values' field type '0.25'

Condition on Sequence flows

We use an expression to return a Boolean value as a Sequence Flow's condition, which plays a key role in the flow's logic.

On the 'Repair Car' diagram, refer to the Have Further Issues? Gateway element. Click on the:

  • More Issues to Repair Sequence Flow and in the Configure BPSim window click on the New Parameter drop-down arrow, and create a Control parameter called 'Condition'; in the 'Values' field click on the Browse. button, click on the 'Expression' tab and type {noOfIssues} != 0 in the 'Expression' field
  • No More Issues to Repair Sequence Flow and in the Configure BPSim window click on the New Parameter drop-down arrow, and create a Control parameter called 'Condition'; in the 'Values' field click on the Browse. button, click on the 'Expression' tab and type {noOfIssues} = 0 in the 'Expression' field

Note: All the outgoing transitions from a Gateway should include 100% of the logic; for example, you would not enter {noOfIssues} > 10 and {noOfIssues} < 5 as condition expressions, because values in the range [5, 10] will not be handled by any outgoing Sequence Flows.

Run Simulation

  1. On the Configure BPSim window click on the 'Execute' tab and on the icon in the toolbar.
  2. When the simulation is complete, the Execute tab provides results similar to these:

Token Analysis

  • 20 customers arrived, matching the number we calculated manually (see Customer Arrives in the Configure BPSim table)
  • 8 customers out of the 20 did not accept the initial estimate, whilst 12 of the 20 accepted and had their car repaired; these figures roughly match the 1/3 and 2/3 probabilities
  • 64 tokens passed the Gateway New Issue Found?, of which 19 had new issues and 45 did not; these figures roughly match the 1/4 and 3/4 probabilities

Analysis on individual customers

Click on the button on the toolbar to open the 'BPSim PropertyParameter Values' dialog. As there are 20 customers (tokens), you can input a value between 0 and 19 in the 'Token Number' field and click on the Query button to do some analysis:

  • This customer did not accept the initial estimate, as shown on the 'Group by Property' tab:
  • This customer's car had only one issue, which was fixed:
  • This customer's car had three known issues and three other issues were found during repair, so in total six issues got fixed (perhaps this is a really old car); switching to the 'Group by Element' tab: