Slide 5 - BPMN

Download as pdf or txt
Download as pdf or txt
You are on page 1of 131

BPMN

Enterprise and Business Process Modelling


Barbara Re
Outline

• Motivations and Definition

• Business Process Life-Cycle

• Classification of Business Process

2
BPMN
• Business Process Modelling Model and Notation = BPMN
• The primary goal of BPMN is to provide a notation that is readily
understandable by all business users:
• the business analysts that create the initial drafts of the process,
• the technical developers responsible for implementing the technology that
will perform those process
• the business people who will manage and monitor those processes
• Thus, BPMN creates a standardized bridge for the gap between the
business process design and process implementation
• We focus on it since it is the de facto standard notation to model BPs
in particular within industrial contexts
3
The vendors realized immediately there was a need of a
graphical representation for the language oriented towards the

History needs of business users. Not a notation that directly represents


the precise execution language under development.

In 2001 BPMI (Business


Process Management
Initiative) developed BPML
In 2004 BPMN 1.0 In Feb.2008 BPMN 1.1 BPMN 1.2 does not
as an XML process
was released to the was released to the include any significant
execution language.
public and in 2006 it public, making the graphical changes;
was adopted as meaning of the modifications were
OMG standard. notation more explicit. merely editorial. 4
BPMN 1.2 vs BPMN 2.0
• BPMN 1.2 provides a mapping from a “valid” BPMN diagram to BPEL,
such that an engine can execute the process
• The 1.2 specification provides only contained verbal descriptions of the
graphic notations elements and modeling rules, this leads to misleading and
confusions in the translation process
• BPMN 2.0 beta 2 was introduced in June 2010
• It represents the biggest revision of BPMN since its inception
• BPMN 2.0 received a formal definition in the form of a meta-model,
that is a precise definition of the constructs and rules needed for
creating specific models

5
BPMN 2.0 Meta-model
• Metamodelling provides a number of
benefits:
• It formalizes the definition of
models and entities
• It formalizes the relationship
between elements
• It enables interoperability
• The new version’s specification
document has got comprehensive
UML class diagram that graphically
show the features of the different
BPMN constructs and their
relationships

6
BPMN 1.2 vs BPMN 2.0
• The metamodel also has got additional language constructs that cannot be
represented in the graphic models.
• Such constructs are required by process engines to capture the necessary additional
information for process execution.

• Moreover, the metamodel was the basis for the development on an


exchange format for BPMN models
• Up to now, it was almost impossible to transfer BPMN models from one tool into
another.
• Some tools have got import and export interfaces for the exchange of BPMN models
by means of the XPDL format, but the use of XPDL for this purpose is not widely
accepted yet.
• Moreover, XPDL has not been implemented uniformly by all vendors, so that in
practice there are quite often problems with model exchange

7
BPMN 2.0 (http://www.bpmn.org/)

8
BPMN 2.0 manifesto

9
BPMN 2.0 - models
• Processes, including
• Private (internal) Business Processes
• Public Processes
• Choreographies
• Collaborations, which can include Processes and/or Choreographies
• A view of Conversations

Enterprise and Business Process Modelling 10


BPMN 2.0 model types

Enterprise and Business Process Modelling 11


Process: Private Business Process
(executable or not)
Private Business Processes are those internal to a specific organization.
An Example:

• An executable Process is a Process that has been modeled for the purpose
of being executed according to the semantics

• A non-executable Process is a private Process that has been modeled for the
purpose of documenting Process behavior at a modeler-defined level of
detail. Thus, information needed for execution, such as formal condition
Expressions are typically not included in a non-executable Process.

12
Process: Public Business Process
A public Process represents the interactions between a private Business
Process and another Process or Participant

An Example:

13
Collaboration Diagram
A Collaboration depicts the interactions between two or more business entities
An Example:

14
Choreography
• A self-contained Choreography is a definition of the expected behavior, basically a procedural
contract, between interacting Participants

• While a normal Process exists within a Pool, a Choreography exists between Pools (or Participants)

An Example:

15
Conversation Diagram

• The Conversation diagram


is a particular usage of and
an informal description of
a Collaboration diagram

• A Conversation is the
logical relation of Message
exchanges

16
Process / Collaboration
Diagram
Business Process Management and Flexibility
Barbara Re, Phd

17
Basic Elements

Used for simple business process modelling, understood by majority


of business process related stakeholders

18
Basic Elements

Enterprise and Business Process Modelling 19


Simple BP model in BPMN

Order
received

Order
processed

20
Resources
• BPMN provides two constructs to model resource aspects:
• Pools are generally used to model resource classes
• Lanes are used to partition a pool into sub-classes or single resources. Lanes
can be nested within each other in multiple levels.
• There are no constraints as to what specific resource type a pool or a
lane should model
• We would typically use:
• A pool to model a business party like a whole organization
• A lane to model a department, unit, team or software system/equipment within that
organization

21
Simple BP model with resources information

22
Message Flow
} A message
flow
represents the
flow of
information
between two
separate
resource
classes (pools)

23
Black box or white box?
• Modeling a pool as a white box or as a black box is a matter of
relevance
• When working on a collaboration diagram, an organization may
decide whether or not to expose their internal behavior depending on
the requirements of the project at hand

24
BP collaboration – message flow

25
BP collaboration with one public
process (supplier)

26
BP collaborating with two public
process

27
Multiple instance pool

28
Activity types in the BPMN
An atomic activity, also called task, is an activity capturing
a unit of work that cannot be further broken down

A sub-process represents a self-contained, composite activity


that can be broken down into smaller units of work

29
Activity Markers

30
Task types
• A send task is a task that send a message. Once the
message is sent, the task is completes
• A receive task is a task that waits to receive a message.
Once the message arrives, the task completes
• User tasks represent traditional workflow tasks that
involve user interaction
• Manual activities are performed without the support of
software systems.
• A Business Rule task is used to synchronously execute one
or more rules.
• A service task is a task that is implemented by a piece of
software, either using a Web services interface or an
application programming interface to a software system.
• A script task is a task that uses some scripting language
expression in order to be performed. Script tasks are used
to represent simple functionality, for which no dedicated
software system is required.

31
Collapsed and expanded sub-process

32
Anything wrong with this model?
Is this better?
Expanded…
Use of Sub-processes
1. Break down large models into smaller ones, making them
easier to understand and maintain
àprocess hierarchies: we can nest sub-processes in multiple levels, so as
to decompose a process model hierarchically

2. Share common fragments across multiple processes


àshared sub-processes

3. Identify parts of a process that should be repeated


Process hierarchies

37
Share common fragments across multiple
processes: Call Activity

The call activity refers to a process model that can be invoked by more than one process
In the same process model collection
38
Share common fragments across
multiple processes: example
Call Activity: reusability and maintanance
• Our default choice should be to define sub-processes as global
process models so as to maximize their reusability within our process
model collection
• Supporting processes such as payment, invoicing, HR, printing, are good
candidates for being defined as global process models, since they are typically
shared by various business processes within an organization
• Besides reusability, another advantage of using global process models
is that any change made to these models will be automatically
propagated to all process models that invoke them

40
Identify parts of a process that should be
repeated

equivalent to:
Identify parts of a process that should
be executed multiple time in parallel
More On the Loop

43
Use of Multiple-Instance Activity (in paralle)

Use of Multiple-Instance
Activity
(in sequence)

44
Exercise - Model the following process
fragment
After a car accident, a statement is sought from two witnesses out of
the five that were present, in order to lodge the insurance claim.

As soon as the first two statements are received, the claim can be
lodged with the insurance company without waiting for the other
statements.

45
Solution

46
Uncontrolled Repetition:
Sample adhoc process
Sometimes we may need to model that one
or more activities can be repeated a
number of times, without a specific order,
until a condition is met.

These activities are uncontrolled, in the


sense that they may be repeated multiple
times with no specific order, or not occur at
all, until a condition is met—in our case the
order being fulfilled.

A partial order may be established among the activities of an ad-hoc sub-process via the
sequence flow. However, we cannot represent start and end events in an ad- hoc sub-
process.
47
Using an ad-hoc sub-process to model
uncontrolled repetition: example

48
Exercise - Model the following process snippet
A typical army recruitment process starts by shortlisting all candidates’
applications. Those shortlisted are then called to sit the following tests: drug
and alcohol, eye, color vision, hearing, blood, urine, weight, fingerprinting
and doctor examination. The color vision can only be done after the eye test,
while the doctor examination can only be done after color vision, hearing,
blood, urine and weight have been tested. Moreover, it may be required for
some candidates to repeat some of these tests multiple times in order to get
a correct assessment, e.g. the blood test may need to be repeated if the
candidate has taken too much sugar in the previous 24 hours. The candidates
that pass all tests are asked to sit a mental exam and a physical exam,
followed by an interview. Only those that also pass these two exams and
perform well in the interview can be recruited in the army.

49
Solution

50
Types of gateways

51
Exclusive Gateways

• Indicates locations within a business process


where the sequence flow can take two or
more alternative paths.
• Only one of the paths can be taken.
• Depicted by a diamond shape that may
contain a marker that is shaped like an “X”.
• We use a XOR-join to merge two or more
alternative branches that may have previously
been forked with a XOR-split.

52
Exclusive gateway with default flow
• Exclusive gateways are locations within a process where there are two or more
alternative paths.
• The criteria for the decision, which the exclusive gateway represents, exist as conditions
on each of the outgoing sequence flow.
• When a token arrives at an exclusive gateway, there is an immediate evaluation of the
conditions that are on the gateway’s outgoing sequence flow. One of those conditions
must always evaluate to true.

53
Exclusive gateway with default flow
- One way for the modeler to ensure that the process does not get stuck at an exclusive gateway is
to use a default condition for one of the outgoing sequence flow.
- The default condition can complement a set of standard conditions to provide an automatic
escape mechanism in case all the standard conditions evaluate to false.
- The default is chosen if all the other sequence flow conditions turn out to be false.

The default condition


has the meening of
“otherwise” and it can
be unlabeled

54
Exclusive gateway with default flow
- When a token arrives at the exclusive gateway, there is no evaluation
of conditions (on the incoming sequence flow), and immediately
moves down the outgoing sequence flow.

The token is passed-


through. There is not
delay incoming condition
evalution or
syncronization

55
Exercise
• As soon as an invoice is received from a customer, it needs to be
checked for mismatches.
• The check may result in either of these three options:
i) there are no mismatches, in which case the invoice is posted;
ii) there are mismatches but these can be corrected, in which case the
invoice is re-sent to the customer; and
iii) there are mismatches but these cannot be corrected, in which case
the invoice is blocked.
• Once one of these three activities is performed the invoice is
parked and the process completes.

56
Solution

57
Exclusive gateways realizing a loop

58
BP with uncontrolled flow

59
BP with split and join activities - livelock

60
Parallel Gateways
• Provide a mechanism to synchronize parallel flows (AND-join) and to create parallel flows
(AND-split), with activities that can be executed concurrently.

• Depicted by a diamond shape that must contain a marker that is shaped like a plus sign.

61
Parallel gateway (Splitting Behaviour)

• When a token arrives at a parallel gateway, there is no evaluation of any conditions on the
outgoing sequence flow.
• The parallel gateway will create parallel paths.
• This means that the gateway will create a number of tokens that are equal to the number of
outgoing sequence flow. One token moves down each of those outgoing sequence flow.

62
Parallel gateway (Merging Behaviour)

• To synchronize the flow, the parallel gateway will wait for a token to arrive from each
incoming sequence flow.
• When the first token arrives, there is no evaluation of a condition for the incoming
sequence flow, but the token is “held” at the gateway and does not continue.
• When all the tokens are arrived, then they are merged and one token moves down the
outgoing sequence flow.

63
Exercise
• Once the boarding pass has been received, passengers proceed to the
security check. Here they need to pass the personal security screening and
the luggage screening. Afterwards, they can proceed to the departure
level.

64
Gateways Combination

65
Inclusive Gateways
• Sometimes we may need to take one or more branches after a decision activity.
• To model situations where a decision may lead to one or more options being
taken at the same time, we need to use an inclusive (OR) split gateway.
• An OR-split is similar to the XOR-split, but the conditions on its outgoing
branches do not need to be mutually exclusive, i.e. more than one of them can
be true at the same time.
• When we encounter an OR-split, we thus take one or more branches depending
on which conditions are true.

66
Inclusive or gateway (Splitting Behaviour)

- Inclusive gateways support decisions where more than one outcome is possible at the decision
point.
- Inclusive gateway with multiple outgoing sequence flows creates one or more paths based on the
conditions on those sequence flow.
- In terms of token semantics, this means that the OR-split takes the input token and generates a
number of tokens equivalent to the number of output conditions that are true.
- Every condition that evaluates to true will result in a token moving down that sequence flow.
- At least one of those conditions must evaluate to true.
67
Inclusive or gateway (Merging Behaviour)

- When the first token arrives at the gateway, the gateway will “look” upstream for each of the other
incoming sequence flow to see if there is a token that might arrive at a later time.

- Thus, the gateway will hold the first token that arrived in the upper path until the other token from
the lower path arrives.

- When all the expected tokens have arrived at the gateway, the process flow is synchronized (the
incoming tokens are merged) and then a token moves down the gateway’s outgoing sequence flow.
68
From BPMN 2.0 Specification
to Process Execution
The Inclusive Gateway is activated if:
• At least one incoming Sequence Flow has at least one token and

• For every directed path formed by Sequence Flow that:


i. starts with a Sequence Flow f of the diagram that has a token,
ii. ends with an incoming Sequence Flow of the inclusive gateway that has no
token,
iii. does not visit the Inclusive Gateway.

• There is also a directed path formed by Sequence Flow that:


i. starts with f,
ii. ends with an incoming Sequence Flow of the inclusive gateway that has a token,
iii. does not visit the Inclusive Gateway.

Enterprise and Business Process Modelling 69


EXAMPLE
f f e6

End
e1 e4 e7

XORs1 XORs2

e0 e8
e2

ANDs1 ORj1
Start End

e3 e5

XORj1

incoming Sequence Flow has at least one token

Enterprise and Business Process Modelling 70


An Example of Deadlock Upstream an OR-Join

incoming Sequence Flow has at least one token

DEADLOCK!

Enterprise and Business Process Modelling 71


An Example of Vicious Circle

e2 ORj3 e4

e1 e9
e5

Start ANDs1 XORj1 End


e3 e6 e8

ORs1 e7 ORj2

Enterprise and Business Process Modelling 72


Exercise
• A company has two warehouses that store different products: Amsterdam
and Hamburg.
• When an order is received, it is distributed across these warehouses: if some
of the relevant products are maintained in Amsterdam, a sub-order is sent
there; likewise, if some relevant products are maintained in Hamburg, a sub-
order is sent there.
• Afterwards, the order is registered and the process completes.

73
A first solution

74
A second solution

75
A third solution with OR gateways

76
What type should we assign to this join?

77
Solution
• Since the OR-join semantics is not simple, the presence of this
element in a model may confuse the reader.
• Thus, we suggest to use it only when it is strictly required.
• Clearly, it is easy to see that an OR-join must be used whenever
we need to synchronize control from a preceding OR-split.
Similarly, we should use an AND-join to synchronize control
from a preceding AND-split and an XOR-join to merge a set of
branches that are mutually exclusive.

78
Handling BPMN Events
• While it comes natural to give a name
(also called label) to each activity, we
should not forget to give labels to events
as well.

• For example, giving a name to each start event


allows us to communicate what triggers an instance
of the process, meaning, when should a new
instance of the process be started.

• Similarly, giving a label to each end event allows us


to communicate what conditions hold when an
instance of the process completes, i.e. what the
outcome of the process is.

79
More on Events

80
BPMN Events
Start Intermediate End

81
Start Event Gateways

82
Message Events
Start Intermediate End

83
BPMN Events
Start Intermediate End

84
Message Events: Throwing and Catching Events

85
Comparison with sending/receiving tasks

=
Receive
invoice
Invoice
received
Is this really the same?

Invoice
= Receive
invoice

received

Invoice
= Send invoice

sent

Invoice
= Send invoice

sent

86
When to use what?

Use message events only when the corresponding activity


would simply send or receive a message and do nothing else
87
Temporal Event and Example

88
Modelling Exceptional Behaviours
(esternal) (time dependent)

??? (internal) ???

89
BP with interrupting boundary event

90
BP with non-interrupting boundary event

91
Interrupting and non interrupting boundary time

92
Process Abortion
• The simplest way of handling an exception is to abort the running process and signal an improper process
termination.

• Observe that if a terminate event is triggered from within a sub-process, it will not cause the abortion of the parent
process but only that of the sub-process, i.e. the terminate event is only propagated downwards in a process
hierarchy.

93
Exception (internal)
Instead of aborting the whole process, we can handle an exception by interrupting the specific activity that has caused the
exception
• An end error event is used to interrupt the enclosing sub-process and throw an exception
• This exception is then caught by an intermediate catching error event which is attached to the boundary of the same sub-
process
• In turn, this boundary event triggers the recovery procedure through an outgoing branch which is called exception flow

94
Racing Events
• A typical scenario encountered when modeling processes with events is the one where two external events
race against one another

• The first of the two events that occurs determines the continuation of the process.

95
Racing Event: Event Based Gateway
• Event-based gateways can be used to avoid behavioral anomalies in the communication between pools.

96
Solution

97
Exercise
Fix the
collaboration
diagram

98
Solution

99
Events Combination

100
Activity Compensation

As soon as the message


is received the
compensation is
activated.

101
Transaction and compensation

MORE IN GENERAL

(An event trigger the


compensation)

102
Reccomandations
• Before adding exceptions it is important to understand the sunny-day
scenario well
• Start by modeling the sunny day scenario.
• Then think of all possible situations that can go wrong.
• For each of these exceptions, identify what type of exception handling
mechanism needs to be used
• First, determine the cause of the exception: internal or external
• Next, decide if aborting the process is enough, or if a recovery procedure needs to be
triggered
• Finally, evaluate whether the interrupted activity needs to be compensated as part of
the recovery procedure.

103
Exercise - Model the following routine for
logging into an Internet bank account
The routine for logging into an Internet bank account starts once the
credentials entered from the user have been retrieved. First, the username is
validated. If the username is not valid, the routine is interrupted and the
invalid username is logged. If the username is valid, the number of password
trials is set to zero. Then the password is validated. If this is not valid, the
counter for the number of trials is incremented and if lower than three, the
user is asked to enter the password again, this time together with a
CAPTCHA test to increase the security level. If the number of failed attempts
reaches three times, the routine is in- terrupted and the account is frozen.
Moreover, the username and password validation may be interrupted should
the validation server not be available. Similarly, the server to test the
CAPTCHA may not be available at the time of log in. In these cases, the
procedure is inter- rupted after notifying the user to try again later. At any
time during the log in routine, the customer may close the web-page,
resulting in the interruption of the routine.
104
Solution

105
Exercise - Model the following process fragment

Once a wholesale order has been confirmed, the supplier transmits this
order to the carrier for the preparation of the transportation quote. In
order to prepare the quote, the carrier needs to compute the route
plan (including all track points that need to be traversed during the
travel) and estimate the trailer usage (e.g. whether it is a full track-load,
half track-load or a single package). By contract, wholesale orders have
to be dispatched within four days from the receipt of the order. This
implies that transportation quotes have to be prepared within 48 hours
from the receipt of the order to remain within the terms of the
contract.
106
Solution

107
Link Events
Start Intermediate End

108
Processes and Business Rules
• A business rule implements an organizational policy or practice.
• For example, in an online shop, platinum customers have a 20 % discount for each purchase above €250.
• Business rules can appear in different forms in a process model.
• They can be modeled
• in a decision activity
• in the condition of a flow coming out of an (X)OR-split
• A third option is to use a dedicated BPMN event called conditional event

109
Exercise - Model the following business
process snippet
In a stock exchange, stock price variations are continuously monitored
during the day. A day starts when the opening bell rings and concludes
when the closing bell rings. Between the two bells, every time the stock
price changes by more than 10 %, the entity of the change is first
determined. Next, if the change is high, a “high stock price” alert is
sent, otherwise a “low stock price” alert is sent.

110
Solution

111
Multiple alternative start events

112
Multiple Start Events

Both need to occur to instantiate the process

113
Information Artifacts
• Data Objects are a mechanism to show how data is
required or produced by activities. Represent input and
output of a process activity

• A Collection Data Object represents a collection of


information, e.g., a list of order items

• A Data Input is an external input for the entire process. A


kind of input parameter

• A Data Output is data result of the entire process. A kind of


output parameter

114
Do data objects affect the token flow?
• Input data objects are required for an activity to be executed.
• Even if a token is available on the incoming arc of that activity, the latter
cannot be executed until all input data objects are also available.
• A data object is available if it has been created as a result of completing a
preceding activity (whose output was the data object itself), or because it
is an input to the whole process (like Purchase order).
• Output data objects only affect the token flow indirectly, i.e. when they
are used by subsequent activities.

115
Process diagram involving data-object

116
Data Store

} A Data Store is a place where the process can read or write data, e.g., a database or a filing cabinet. It persists
beyond the lifetime of the process instance

117
Process Diagram Involving Information Artifact

118
Do we always need to model data objects?

• Data objects help the reader understand the flow of business data
from one activity to the other

• However, the price to pay is an increased complexity of the diagram

• Use them only when they are needed for a specific purpose, e.g. to
highlight potential issues in the process under analysis or for
automation

119
Use of BPMN elements into practice

The BPMN 2.0 [15] defines 50 constructs and their


attributes. However, less than 20% of its
vocabulary is used regularly in designing BP
models [14].

zur Muehlen, Michael and Recker, Jan


C. (2008) How Much Language is
Enough? Theoretical and Practical Use
of the Business Process Modeling
Notation . In Proceedings 20th
International Conference on Advanced
Information Systems Engineering,
Montpellier, France.

120
How much
language
do you
need?

121
BPMN 2.0 free editors
• ADOxx - http://www.adoxx.org/live/home
• Oryx online editor: http://bpt.hpi.uni-potsdam.de/Oryx
• BizAgi editor (Windows): http://www.bizagi.com/
• Sketchpad Java editor (still in development): http://sourceforge.
net/projects/sketchpadbpmn/develop
• Intalio|BPM community edition: http://www.intalio.
com/products/bpm/community-edition/
• Eclipse BPMN modeler: http://www.eclipse.org/bpmn/
• Visio stencils: http://bpt.hpi.uni-potsdam.de/Public/BPMNCorner#Tooling
• Other tools & info: http://bpmn.org/BPMN_Supporters.htm

122
Modeling Environment
• http://academic.signavio.com/p/register?link=49b6ca
940da04308ac5f133740119d41

123
Business Process
(Modelling Activities)

124
Execises
Using a BPMN 2.0 notation model the following process

• Cooking's Apple Pie


• Enrollment at university
• Buy a fly ticket
• Buy a book on-line
• Moving from one city to another

125
Let’s Modelling: Insurance Claim
1. recording the receipt of the claim
2. establishing the type of the claim
3. checking covering of client's policy
4. checking the premium (payments up to date?)
5. rejection, if 3 or 4 has negative result
6. producing a rejection letter
7. roughly estimate the amount to be paid, if 3 & 4 have positive results 8.
appointment of an assessor, if needed
9. revision of the amount offered to the client
10. recording client's reaction
11. assessment of objection: decision to revise 9 or take legal action 12 12.
legal proceedings
13. payment of claim
14. filing and closure of claim
126
Modelling Travel agency

Travel agency: define a series of


task for booking a flight, a hotel
and optionally a car, with the
possibility to change dates, to
cancel the booking, to confirm the
booking. Then, draw a process
diagram relating the tasks.

127
Modelling Coffee break

Coffee break: draw the process diagram for a


vending machine that accepts a coin, then
gives the possibility (1) to get a coffee or (2) to
insert another coin and get either a
cappuccino or a tea. Draw the process
diagrams for a compatible and a
"problematic" butler robot.

128
Modelling Bike Sharing and Bike Travel
Bike Sharing and Bike Travel: define a series of task for bike
traveling, with the possibility to register, to track, and to maintain
the bike. Then, draw a process diagram relating the tasks.

129
BPMN by example

130
Questions?

131

You might also like