University of Paderborn Software Engineering Group E. Kindler
BPM & WfM
Lecture 9
III. Workflow Theory & Analysis
IV. WfM & Transactions
SS 2006, L09 2 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
2. Analysis
Consistency and plausibility
Structural analysis: “Awkward nets” Unused / redundant data or resources Unnecessary orderings
Consistency among different aspects Compliance with business rules ...
Performance Resource planning Performance analysis
SS 2006, L09 3 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
2.1 Resource Planning
Problem
:
Given a business process model.
How many resources / agents are necessary
for completing a certain number of workflows
per time unit?
SS 2006, L09 4 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Resource Planning
Questions
:
What information do we need to answer this
question (in addition to what we have in the
model already)?
How do we calculate the necessary
resources?
University of Paderborn Software Engineering Group E. Kindler
1st Question
Number of processes to be performed per
time unit
Average processing time for each activity
Probabilities for each choice
University of Paderborn Software Engineering Group E. Kindler
SS 2006, L09 7 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
2nd Question (Idea)
! ! 6 + 2 = 8 B 3 + 3 = 6 A ! " "# # ! " SS 2006, L09 8 BPM & WfM: III. Wf Theory & Analysis / IV. TransactionsUniversity of Paderborn Software Engineering Group E. Kindler
2nd Question
For each activity, calculate the number of
processed instances per time unit
For each activity, multiply this number with
the average processing time
Sum up the results for the different resources;
this is the number of resources we need (in
an very ideal case)
SS 2006, L09 9 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Remark
Everyday experience as well as basic results from queuing theory tell us that we can never reach 100% utilization of the resources!
Therefore, the number of resources must be higher than the calculated resources
(for a detailed analysis, more information is needed performance analysis).
$ % &
' '
SS 2006, L09 10 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Remaining Questions
Where do the average processing time and
the probabilities come from?
How do we calculate the number of
processed instances for each activity?
University of Paderborn Software Engineering Group E. Kindler
Remaining Questions
Where do the average processing time and
the probabilities come from?
Experience Measurements Audit trail
University of Paderborn Software Engineering Group E. Kindler
Remaining Questions
How do we calculate the number of
processed instances for each activity?
Inductively over the structure of the workflow net (built from workflow constructs)
For each construct, we give a rule to calculate the number of processed instances for each activity
SS 2006, L09 13 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Calculation for each Construct
(
⋅
) (*⋅
SS 2006, L09 14 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Calculation for each Construct
( ) (*⋅ ⋅ ) ( *⋅ ) ( *⋅ + ' , SS 2006, L09 15 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Remarks
The presented method works for workflows built from workflow constructs only. But, there is a more general theory that works for arbitrary workflow nets (basically the same theory as for performance analysis).
The same method can be used to calculate the average costs of a process.
- .
SS 2006, L09 16 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
2.2 Performance Analysis
The resource calculation gives the necessary resources for the ideal case (100% utilization) only.
waiting times go to infinity
ignores dependencies among different workflows ...
A more detailed performance analysis can give more accurate results (considering all workflows in a system): average completion times, average waiting times, utilization rate etc.
University of Paderborn Software Engineering Group E. Kindler
Disclaimer
Here, we cannot go into the details of the mathematics of performance analysis
Operations research Markov chains Queuing theory Stochastic Petri nets
We restrict ourselves to discuss the additional information necessary for doing (more accurate) performance analysis and to the results
/+ $ 0
University of Paderborn Software Engineering Group E. Kindler
Necessary information
Distribution of interarrival timefor externally triggered activities (in particular start activities)
Type of distribution
(markovian, non-markovian, ...)
mean interarrival time and standard deviation
Distribution of processing timefor all activities Probabilities for selection of particularchoices (this depends on the underlying stochastic model)
SS 2006, L09 19 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Results
Dependent on the underlying stochastic model and the used distributions, analytic techniques or simulation can give us the following results:
Average completion time for each process (time for finishing the process)
Average processing time for each process (time effectively processing activities of the process) Average waiting timefor each process
(completion time – processing time)
Utilizationof resources ...
SS 2006, L09 20 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Remark
As with resource planning, performance analysis can be also used for analysing costs.
SS 2006, L09 21 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
IV. Transactions
Motivation & Basic Concepts
Atomic spheres
Compensation spheres
...
12 , 34+ SS 2006, L09 22 BPM & WfM: III. Wf Theory & Analysis / IV. TransactionsUniversity of Paderborn Software Engineering Group E. Kindler
1. Motivation and Basic Concepts
Motivation
Transactions and ACID principle
Problems with long-lived transactions
Advanced transaction models
University of Paderborn Software Engineering Group E. Kindler
Motivation
Sometimes,
workflows are
defined as
long-lived transactions
This is not completely true, but there is much
truth in it.
Here will discuss this definition and introduce
some transaction concepts to workflows.
-University of Paderborn Software Engineering Group E. Kindler
Transaction: Definition
A transaction is a set of related actions that
virtually appear to be executed
instantaneously,
i.e. they are executed according to the
ACID
SS 2006, L09 25 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
ACID principle
Atomicity: Either all of the actions are (appear to be) executed or no action is executed (all or nothing). Consistency: The activities are (appear to be)
executed only when they results in a consistent state.
Isolation: The activities (appear to be) executed without the interference of activities of other transactions
Durability: The changes of a successfully executed transaction survive system failures.
SS 2006, L09 26 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Examples of transaction
Sale:
transfer goods and transfer money Booking a trip:
book a hotel, book a flight, and rent a car Money transfer:
debit one account and credit the other account
SS 2006, L09 27 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
BPs and the ACID principle
It would be nice to apply the ACID principle to
business processes.
business processes are long-lived
transactions
But, the price is too high!
SS 2006, L09 28 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
The price of the ACID principle
The longer a process runs the higher the probability that some of its activities fail
This applies in particular when traditional transaction protocols are used (locking protocols are prone to deadlocks).
Then, the ACID principle implies that the complete process fails.
The effort put into the process is completely lost – years of work (and millions of Euros) would be lost.
University of Paderborn Software Engineering Group E. Kindler
The price of the ACID principle
Moreover,
performance would be extremely poor.
some activities must have an externally visible effect (letters, payments, ...) before other activities are executed;
then, the ACID principle guarantees that all remaining activities will be successfully executed in the future.
Nobody can give such a guarantee.
University of Paderborn Software Engineering Group E. Kindler
Advanced Transaction Models
There are some concepts for solving some of the above problems:Nested transactions: A transaction consists of sub-transactions, which are independent from each other
Compensations: Each action within a transaction has an associated compensation action, which “undoes” the effect of the action.
Reliable messaging systems: Each successfully sent message is guaranteed to be successfully delivered exactly once.
SS 2006, L09 31 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Workflows
are
advanced
long-lived
transactions
- 5 ' . SS 2006, L09 32 BPM & WfM: III. Wf Theory & Analysis / IV. TransactionsUniversity of Paderborn Software Engineering Group E. Kindler
2. Atomic Spheres
Basic idea
:
An atomic sphere is a set of activities within a
workflow, that are executed atomically (i.e. all
or nothing).
no consistency no isolation no durability $ 3+ ' 5 2 5 SS 2006, L09 33 BPM & WfM: III. Wf Theory & Analysis / IV. TransactionsUniversity of Paderborn Software Engineering Group E. Kindler
6
' 6
6
Example: Book a Trip
SS 2006, L09 34 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Example: Book a Trip
All activities of an atomic sphereare executed under the control of a transaction
(the corresponding activities must be transactional) If one activity of the atomic sphere aborts(fails), all activities are aborted
If all enabled activities were successful, all activities are committed.
- (
University of Paderborn Software Engineering Group E. Kindler
6
' 6
6
Example: Book a Trip
77
- 5
University of Paderborn Software Engineering Group E. Kindler
Discussion
If we cannot contact the customer, this activity can be aborted; accordingly, all activities of the atomic sphere are aborted.
Atomic spheres help to concentrate on the normal behaviour of a process
The transaction monitors deals with the exceptions (details depend on the underlying transaction monitors).
SS 2006, L09 37 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Extensions
Retries: Each atomic sphere is assigned an upper limit for the number of retries.
Final fail: When an atomic sphere finally fails, one of the following actions is taken:
Notifysome agent (e.g. process administrator)
Skipatomic sphere, i.e. treat all activities of the sphere as dead activities and do dead path elimination
SS 2006, L09 38 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler 6 ' 6 6
Extensions:
77 8 ," 9 , SS 2006, L09 39 BPM & WfM: III. Wf Theory & Analysis / IV. TransactionsUniversity of Paderborn Software Engineering Group E. Kindler
Problems
In principle, atomic spheres have the same problem as classical transaction!
But, atomic spheres can be used to restrict the problem to small parts of a workflow!
For increasing performance, atomic spheres should run fast.
To this end and for technical reasons, there are some syntactical restrictions for atomic spheres:
SS 2006, L09 40 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Restrictions
Single entry point
:
1 1
University of Paderborn Software Engineering Group E. Kindler
Restrictions: Single Entry
Also okay:
:
University of Paderborn Software Engineering Group E. Kindler
Restrictions: Single Entry
Not okay:
:
SS 2006, L09 43 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Restrictions: Single Entry
Not okay:
1 1 -, ' 5 SS 2006, L09 44 BPM & WfM: III. Wf Theory & Analysis / IV. TransactionsUniversity of Paderborn Software Engineering Group E. Kindler
Restrictions
Atomic spheres must not overlap!
SS 2006, L09 45 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Restrictions
The
applications
of the activities of an
atomic sphere must be
transactional
(i.e. it must be able to execute them under
transaction control)
This is a technical restriction only; but serious
one.
SS 2006, L09 46 BPM & WfM: III. Wf Theory & Analysis / IV. Transactions
University of Paderborn Software Engineering Group E. Kindler
Desirable
Activities within the atomic sphere should be
automatic
(manual activities are slow)