Process modeling

Download Report

Transcript Process modeling

Analysis of workflows:
Verification, validation, and performance analysis.
Wil van der Aalst
Eindhoven University of Technology
Faculty of Technology Management
Department of Information and Technology
P.O. Box 513
5600 MB Eindhoven
The Netherlands
[email protected]
1
Design-time and run-time questions
Run-time
Design-time
diagnosis
process
enactment
•process mining
process
design
implementation/
configuration
•verification
validation
performance
analysis
2
Techniques to analyze workflows (design-time)
• Validation is concerned with the relation between the model and reality.
• Verification is typically used to answer qualitative questions
– Is there a deadlock possible?
– It is possible to successfully handle a specific case?
– Will all cases terminate eventually?
– It is possible to execute two tasks in any order?
• Performance analysis is typically used to answer quantitative questions
– How many cases can be handled in one hour?
– What is the average flow time?
– How many extra resources are required?
– How many cases are handled within 2 days?
3
Verification: analysis techniques can be used to avoid logical errors.
c3
check_policy
start
register
send_letter
c1
c4
c2
c5
check_damage
ready
pay_damage
c6
Is this a correct workflow?
If not, how to correct it?
4
start
t1
It this process correct?
c1
c7
c15
t17
t2
t7
t13
c20
c2
c8
c16
t18
t3
t8
t14
t21
c17
t19
c3
c9
c10
t9
t4
t10
c6
c22
t15
t20
c4
c11
c12
t5
t11
c5
c13
c14
c18
t21
t16
c19
t12
t6
c23
t22
klaar
5
Error 1: dangling tasks
task4
begin
task1
task5
task2
task3
end
6
Error 2: deadlock (task2)
task2
begin
task1
end
7
Error 3: unbounded and never-ending
begin
task1
task2
task3
end
8
Error 4: deadlock before or after termination
begin
task1
task2
task3
end
9
Soundness property
Eventually the case
terminates and the
moment it terminates
all references have
been removed.
process definition
begin
end
• The soundness property corresponds to two standard Petri-net
properties (liveness and boundedness).
• Standard Petri-net-based tools can be used.
• For (almost) free-choice nets this can be checked in polynomial
time!
10
Petri-nets: a solver-independent medium
problem
toolbox
modeling
analysis
Petri net description
reachability analysis
Markovian analysis
structural analysis
OR-techniques
simulation
answers
11
Reachability analysis
red1
red2
safe
yr1
yr2
yellow1
rg1
gy1
yellow2
rg2
gy2
green1
green2
12
Reachability graph
• Each node corresponds to a reachable state.
• Done by a computer.
• A computer can cope with reachability graphs with millions of
nodes.
(0,0,1,1,0,0,0)
(1,0,0,0,0,1,0)
(1,0,0,1,0,0,1)
(0,1,0,1,0,0,0)
(1,0,0,0,1,0,0)
The traffic lights are safe!
13
Exercise: construct reachability graph
c3
check_policy
start
register
send_letter
c1
c4
c2
c5
check_damage
ready
pay_damage
c6
14
Structural analysis
Many techniques are available:
• place invariants
• transition invariants
• traps and siphons
• reduction rules
• decomposition techniques
• S-covers/T-covers
• special techniques for subclasses:
– state machines
– marked graphs
– free-choice nets
– asymmetric free-choice nets
15
Place invariants
• A place invariant assigns a weight to each place such that the
weighted token sum remains constant.
man
couple
marriage
• 1man + 1woman+2couple =constant
(man+woman+2couple=7)
• woman + couple
• man + couple
• man - woman
divorce
woman
16
Example
red1
red2
safe
yr1
yr2
yellow1 yellow2
rg1
gy1
rg2
gy2
green1
green2
red1+yellow1+green1 = 1
red2+yellow2+green2 = 1
safe + green1 + green2 + yellow1 + yellow2 = 1
red1 + red2 - safe = 1
17
Place invariants can be used to check detect errors
begin
end
• There should be a positive place invariant assigning positive
weights to all places and identical weights to begin and end.
• 1.begin + 1.end + ..... = constant
18
Exercise
c3
send_letter
check_policy
c1
start
register
c2
c4
c5
ready
check_damage
pay_damage
c6
Use place invariants to motivate the correctness of the process definition.
19
Example
process_form
c1
send_form
c5
c3
archive
time-out
evaluate
start
register
c7
ready
c2
c6
Sound?
P-inv.?
c4
check_proc
process_complaint
20
Example (2)
process_form
c1
send_form
c5
c3
time-out
archive
evaluate
start
register
ready
c2
c6
Sound?
P-inv.?
c4
check_proc
process_complaint
21
Example (3)
process_form
c1
send_form
c5
c3
evaluate
start
register
time-out
archive
c8
c7
ready
c2
c6
Sound?
P-inv.?
c4
check_proc
process_complaint
22
Example (4)
process_form
c1
send_form
c5
c3
archive
time-out
evaluate
start
register
c7
ready
c2
c6
Sound?
P-inv.?
check_proc
c4
process_complaint
23
Example (5)
process_form
c1
send_form
c3
c5
time-out
archive
evaluate
start
register
c7
ready
c2
c6
Sound?
P-inv.?
c4
check_proc
process_complaint
24
Transition invariants
• A transition invariant assigns a weight to each transition such that the net effect of
firing each transition the specified number of time is zero, i.e., the initial
marking is reproduced.
man
couple
marriage
• marriage + divorce
• 2.marriage + 2.divorce
divorce
woman
25
Transition invariants can be used to detect errors
short-circuited net
begin
end
• There should be a positive transition invariant assigning
positive weights to all transitions.
26
Example
c3
check_policy
start
register
send_letter
c1
c4
c2
c5
check_damage
ready
pay_damage
c6
• Give transition invariants of short-circuited net.
27
Why invariants?
• Can be calculated efficiently (polynomial time
for a basis).
• Independent of initial marking.
• However, the main reason is didactical! You
only truly understand a model if you think
about it in terms of invariants!
28
Performance analysis
Questions:
• throughput, waiting and service times
• service levels
• occupation rates
Techniques:
• simulation
• queuing theory
• Markovian analysis
29
Example: sequential (1)
24 arrivals per hour
2 resources, average
service time of 4 minutes
2 resources, average
service time of 4 minutes
c1
task1
c2
task2
c3
• average throughput time : 22.2 minutes
• service time: 8.0 minutes
• waiting time: 14.2 minutes
30
Parallel (2)
24 arrivals per hour
2 resources, average
service time of 4 minutes
c21
task1
c23
c22
task2
c24
c1
c3
2 resources, average
service time of 4 minutes
• average throughput time : 15 minutes
• service time: 4 minutes
• waiting time: 11 minutes
31
Compose (3)
24 arrivals per hour
4 resources, average
service time of 7 minutes
c1
task12
c3
• average throughput time : 9.5 minutes
• service time: 7.0 minutes
• waiting time: 2.5 minutes
32
Flexible resources (4)
24 arrivals per hour
4 resources, average
service time of 4 minutes
c1
task1
c2
task2
c3
• average throughput time : 14.0 minutes
• service time: 8.0 minutes
• waiting time: 6.0 minutes
33
Triage (5)
1 resource, average
service time of 8 minutes
difficult cases
6 difficult
cases per hour
2 resources, average
service time of 4
minutes
c21 task1a
c1
18 easy cases
per hour
c23
c22 task1b
easy cases
task2
c3
1 resource, average
service time of 2.66 minutes
• average throughput time : 31.1 minutes
• service time: 8.0 minutes
• waiting time: 23.1 minutes
34
Priority (6)
easy cases have priority
2 resources, average
service time 8 (difficult case) or
2.66 (easy case) minutes
6 difficult cases
per hour
task2
c1
18 easy cases
per hour
task1
c2
c3
easy cases have priority
2 resources, average
service time 8 (difficult case) or
2.66 (easy case) minutes
• average throughput time : 14 minutes
• service time: 8 minutes
• waiting time: 6 minutes
35
Results
situation
description
average
throughput t.
Situation 1
sequential
Situation 2
parallel
Situation 3
compose
Situation 4
flexibility
average
service time
average
waiting t.
22.2
8.0
14.2
15
4(8)
11(7)
9.5
7.0
2.5
14.0
8.0
6.0
Situation 5
triage
31.1
8.0
23.1
Situation 6
priorities
14.0
8.0
6.0
36
Queuing models
service
waiting
arrivals
l
c
m
Basic characteristics:
• average number of arrivals per time unit: l (mean arrival rate)
• average number that can be handled by one server per time unit: m
(mean service rate)
• number of servers: c
41
Queuing models (2)
l
m
c
W,Lq
S,L
W (S) = average time in queue (system)
Lq (L) = average number in queue (system)
Basic relationships:
• average time between arrivals: 1/l
• average service time: 1/m
• occupation rate: r = l/(c*m)
• average number being served: r = l/m
•
•
•
•
L = Lq + r
S = W + 1/m
Lq = l * W
L = l * S (Little’s formula)
42
M/M/1 queue
l
1
Assumptions:
• time between arrivals and service time
follow a negative expontential
distribution
• 1 server (c = 1)
• FIFO
•
•
•
•
m
Lq = (l* l)/(m * (m-l))
L = l/(m-l) = r/(1-r)
W = r/(m-l)
S = 1/(m-l)
Also formulas for M/Er/1, M/G/1, M/M/c, ... !
43
Exercise
1 resource, average
service time of 8 minutes
difficult cases
6 difficult
cases per hour
1 resource, average
service time of 2
minutes
c21 task1a
c1
18 easy cases
per hour
c23
c22 task1b
easy cases
Calculate:
• occupation rates,
• average waiting time,
• average throughput time,
• average number in system.
task2
c3
1 resource, average
service time of 2.66 minutes
Increase the occupation rate until 90%:
• average waiting time,
• average throughput time,
• average number in system.
44
Simulation
• Random walk through the reachability graph
• Computer experiment
– pseudo random numbers
– random generator
• Validation
• Statistical aspects
– start run
– subruns
• Animation
• Flexible
• No proof!
45
Simulation using Protos/ExSpect
46