Topic
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

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

Create the sub process Repair Car

  • Create a Start Event Start Repairs
  • Add a Sequence Flow to a target Exclusive Gateway converge Gateway1
  • Add a Sequence Flow to an abstract task Activity Inspect for Issue
  • Add a Sequence Flow to an Exclusive Gateway converge Gateway2
  • Add a Sequence Flow to an Exclusive Gateway New Issue Found?
  • 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?
  • From the Gateway Have further issues? add Sequence Flows to:
         -  A target End Event Repairs Completed
        converge Gateway1

Configure BPSim

Task

Description

Artifact and Package

  • Open the Configure BPSim window ('Simulate > BPSim > Manage > Open BPSim Manager')
  • Create a Business Process Simulation Artifact named IntermediateEvent - Boundary - Error
  • Select the Package containing the corresponding BPMN 2.0 model

All of the BPMN elements will be loaded in to the Configure BPSim window.

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 left hand panel of the 'Configure BPSim' dialog, click on the 'Scenario' item in the tree; the 'Scenario' tab is activated.

  • In the 'Start' field, select any date and change the time section to '9:00 AM'
  • Set the 'Duration' field to '0000 007:50:00' (Tips: the format is: dddd hh:mm:ss)

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:36PM = 456 minutes, number of customers: 456/24 + 1 = 19 + 1 = 20). We will verify this with the simulation result later.

Expand the 'StartEvent' group and select Customer Arrives. Click on the 'Control' tab and the 'New Parameter' drop-down arrow, and select 'InterTriggerTimer'. In the 'Value' and 'Unit' fields type 24 and select 'min' (for '24 minutes').

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 TruncatedNormal distribution to initialize the property noOfIssues. Tasks Repair Issue and Handle New Found Issue will decrement and increment the value of noOfIssues respectively.

  • Click on the Customer Arrives Start Event and on the 'Properties' tab
  • Overtype New Property with noOfIssues, and in the 'Value' field click on the button; the 'Parameter Value' dialog displays
  • Click on the 'Distribution' tab and select the 'TruncatedNormal' distribution type; in the fields 'Mean', 'StandardDeviation', 'Min' and 'Max' type the values 2, 1, 1 and 1000 respectively

Important Note: Some 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 Save button on the toolbar so that the created property name is shown in the bottom panel of the 'Property' tab; click on the 'Value Type' drop-down arrow and select the value 'int' instead of the default 'double'.

  • Click on the Activity Repair Issue and on the 'Properties' tab, and overtype the New Property text with noOfIssues
  • In the 'Value' field click on the button; the 'Parameter Value' dialog displays
  • Click on the 'Expression' tab and, in the 'Expression' field, type {noOfIssues} -1; click on the OK button
  • Click on the Activity Handle New Found Issue and on the 'Properties' tab, and overtype the New Property text with noOfIssues
  • In the 'Value' field click on the button; the 'Parameter Value' dialog displays
  • Click on the 'Expression' tab and, in the 'Expression' field, type {noOfIssues} +1; click on the OK button

Probability on Sequence Flows

We assume that 1/3 of the customers will not accept the initial estimate for repairs and 2/3 will accept it. We also assume that for 1/4 of the repairs new issues will be found, and for 3/4 of the repairs no new issues will be found.

Expand the 'Gateway' group in the left-hand tree, and expand the Accepted? element. For the:

  • Initial Estimate Accepted Sequence Flow, click on the 'Control' tab and on the 'New Parameter' drop-down arrow, and select 'Probability'; in the 'Value' field type 0.67
  • Initial Estimate Not Accepted Sequence Flow, click on the 'Control' tab and on the 'New Parameter' drop-down arrow, and select 'Probability'; in the 'Value' field type 0.33

In the 'Gateway' group, expand the New Issue Found? element. For the:

  • No More Issues to Repair Sequence Flow, click on the 'Control' tab and on the 'New Parameter' drop-down arrow, and select 'Probability'; in the 'Value' field type 0.75
  • More Issues to Repair Sequence Flow, click on the 'Control' tab and on the 'New Parameter' drop-down arrow, and select 'Probability'; in the 'Value' 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.

In the 'Gateway' group, expand the Have Further Issues? element. For the:

  • More Issues to Repair Sequence Flow, click on the 'Control' tab and on the 'New Parameter' drop-down arrow, and select 'Condition'; in the 'Value' field click on the button to open the parameter dialog, click on the 'Expression' tab and type {noOfIssues} != 0 in the 'Expression' field
  • No More Issues to Repair Sequence Flow, click on the 'Control' tab and on the 'New Parameter' drop-down arrow, and select 'Condition'; in the 'Value' field click on the button to open the parameter dialog, click on the 'Expression' tab and type {noOfIssues} = 0 in the 'Expression' field

Note: All the outgoing transitions from a Gateway should cover 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

  • From the 'Configure BPSim' dialog toolbar, click on the Run button; the 'BPSim Simulation Controller' dialog displays
  • Click on the Run button and select 'Standard Simulation'
  • When the simulation is complete, it provides this result:

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 which19 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: