Methods for the specification and verification of business processes...
Transcript of Methods for the specification and verification of business processes...
Methods for the specification and verification of business processes
MPB (6 cfu, 295AA)
Roberto Bruni http://www.di.unipi.it/~bruni
14 - Analysis of WF nets
1
Object
2
We study suitable soundness properties of Workflow nets
Ch.6 of Business Process Management: Concepts, Languages, Architectures
WF nets as business processes
3
48
Transition realised by another workflow net
Structural analysis
4
No distinguished entry / exit point
no entry: when should the case start? no exit: when should the case end?
ruled out by definition of workflow nets
Structural analysis
5
Multiple entry / exit points
multiple entries: when should the case start? multiple exit: when should the case end? ruled out by definition of workflow nets
Structural analysis
6
Tasks t without incoming and/or outgoing arcs
no input: when should t be carried out? no output: t does not contribute to case completion
ruled out by definition of workflow nets
Structural analysis
7
Wrong decorations of transitions
split with only one outgoing arc
join with only one incoming arc
left to designer responsibility
Activity analysis
8
Dead tasks
Tasks that can never be carried out Each transitions lies on a path from i to o: not sufficient
can arise in workflow nets
Token analysis
9
Some tokens left in the net after case completion
(when a token is in the final place the case should end) can arise in workflow nets
Activity analysis
10
If tokens are left in the net after case completion then
activities may still take place after case completion
it is a (worse) consequence of the previous flaw can arise in workflow nets
Token analysis
11
More than one token reach the end place
it can be a consequence of the previous flaws can arise in workflow nets
Net analysis
12
Deadlock
a case blocks without coming to an end can arise in workflow nets
Question time
13
Do you see any problem in the workflow net below?
Question time
15
Do you see any problem in the net below?
Question time
17
Do you see any problem in the workflow net below?
Question time
20
Do you see any problem in the workflow net below?
Exercise
24
Livelock (divergence without producing output)
a case is trapped in a cycle with no opportunity to end can arise in workflow nets
Draw a workflow net that suffers from livelock
Remark
25
All the previous flaws are typical errors that can be detected
without any knowledge about the actual content of the Business Process
Verification and validation
26
Validation is concerned with the relation between the model and the reality
How does a model fit log files? Which model does fit better?
Verification aims to answer qualitative questions Is there a deadlock possible?
Is it possible to successfully handle a specific case? Will all cases terminate eventually?
Is it possible to execute a certain task?
Simulation techniques
27
Test analysis Try and see if certain firing sequences are allowed by the
workflow net
Using WoPeD: Play (forward and backward) with net tokens
Record certain runs (to replay or explain) Randomly select alternatives
Problem: how to make sure that all possible runs have been examined?
Reachability analysis
28
Verification by inspection All possible runs of a workflow net are represented in its
Reachability Graph (when it is finite)
Using WoPeD: all reachable states are shown
(a single run does not necessarily visit all nodes) End states are evident (no outgoing arc)
Useful to check if dangerous or undesired states can arise (e.g. the green-green state in the two-traffic-lights)
Problem: state explosion
29
Boundedness (for Nets)
Proposition: The reachability graph of a net is finite
if and only if
the net is bounded
30
Boundedness (for Nets)
Proposition: A net is unbounded
if and only if
its reachability graph is not finite
31
Coverability graph
A coverability graph is a finite over-approximation of the reachability graph
It allows for markings with infinitely many tokens in one place (called extended bags)
B : P �⇥ N ⌅ {⇤}
Suppose
M0t1�⇤ M1
t2�⇤ M2 ...ti�⇤ Mi ...
tj�⇤ Mj
with Mi ⇥ Mj
Let M = Mi and M ⇥ = Mj and L = M ⇥ �M
By the monotonicity Lemma we have, for any n ⌅ N:M ⇤� M + L ⇤� M + 2L ⇤� ... ⇤� M + nL
Hence all places p marked by L (i.e. if L(p) > 0) are unbounded32
Discover unbounded places
33
Cover unbounded places
Idea:When computing the RG, if M ⇥ is found s.t.
M0 ⇤� M ⇤� M ⇥ with M ⇥ M ⇥
Add the extended bag B (instead of M ⇥) to the graph
where B(p) =
�M ⇥(p) if M ⇥(p)�M(p) = 0⌅ otherwise
34
A few remarks
Idea: mark unbounded places by ⇧
Remind: M ⇤ M ⇥ means that M � M ⇥ � M ⌥= M ⇥, i.e.,1. for any p ⌃ P , M ⇥(p) ⇥ M(p)2. there exists at least one place q ⌃ P such that M ⇥(q) > M(q)
Remark:Requiring M0 ⌅� M ⌅� M ⇥ is di�erent thatrequiring M,M ⇥ ⌃ [M0
than
35
Operations on extended bags
Inclusion: Let B,B� : P ⌅ N ⌥ {⇧}We write B ⇥ B� if for any p we haveB�(p) = ⇧ or B(p), B�(p) ⌃ N � B(p) ⇤ B�(p)
Sum: Let B,B� : P ⌅ N ⌥ {⇧}
(B +B�)(p) =
�⇧ if B(p) = ⇧ or B�(p) = ⇧B(p) +B�(p) if B(p), B�(p) ⌃ N
Di�erence: Let B : P ⌅ N ⌥ {⇧} and M : P ⌅ N with M ⇥ B
(B �M)(p) =
�⇧ if B(p) = ⇧B(p)�M(p) if B(p) ⌃ N
41
Compute a reachability graph1. Initially N = { M0 } and A = ∅ 2. Take a bag B ∈ N and a transition t ∈ T such that
1. B enables t and there is no arc labelled t leaving from B
3. Let B' = B - •t + t• 4. Add B' to N and (B,t,B') to A 5. Repeat steps 2,3,4 until no new arc can be added
(all bags are finite in this case)
42
Compute a coverability graph1. Initially N = { M0 } and A = ∅ 2. Take a bag B ∈ N and a transition t ∈ T such that
1. B enables t and there is no arc labelled t leaving from B
3. Let B' = B - •t + t• 4. Let Bc' such that for any p ∈ P
1. Bc'(p) = ∞ if there is a node B'' ∈ N such that
1. there is a directed path from B'' to B in the graph (N,A) 2. B'' ⊂ B', 3. B''(p) < B'(p)
2. Bc'(p) = B'(p) otherwise
5. Add Bc' to N and (B,t,Bc') to A 6. Repeat steps 2,3,4,5 until no new arc can be added
B00�
!!
⇢ B0
B
t>>
Example
43
p3 i p2 o
Example
44
p3 i p2 o
p3 i p2 o
Example
45
p3 i p2 o
p3 i p2 o
p3 i p2 o
Example
46
p3 i p2 o
p3 i p2 o
p3 i p2 o
p3 i p2 o
(0 0 1 1)
Example
47
p3 i p2 o
p3 i p2 o
p3 i p2 o
p3 i p2 o
(0 0 1 1)
Example
48
p3 i p2 o
p3 i p2 o
p3 i p2 o
p3 i p2 o
∞
Example
49
p3 i p2 o
p3 i p2 o
p3 i p2 o
p3 i p2 o
p3 i p2 o
∞
Properties of coverability graphs
50
A coverability graph is always finite, but in general it is not uniquely defined
(it depends on which B and t are selected at step 2)
Every firing sequence has a corresponding path in the CG (the converse is not necessarily true)
Any path in a CG that visits only finite markings corresponds to a firing sequence
If the RG is finite, then it coincides with the CG
Reachability analysis by coverability
51
All possible behaviours of a workflow net are represented exactly in the Reachability Graph (if finite)
We use Coverability Graph when necessary (RG not finite)
WoPeD computes a Coverability Graph
Exercise
52
Do you see any problem in the workflow net below?
Exercise
53
Which problem(s) in the workflow net below? How would you redesign the business process?
Soundness
54
Soundness of Business Processes
55
A process is called sound if
1. it contains no unnecessary tasks
2. every case is always completed in full
3. no pending items are left after case completion
56
Business Process
i o
Soundness of Business Processes
Soundness of Workflow nets
57
A workflow net is called sound if
1. for each transition t,
there is a marking M (reachable from i) that enables t
2. for each token put in place i,
one token eventually appears in the place o
3. when a token is in place o, all other places are empty
Fairness assumption
58
Remark:Condition 2 does not mean that iteration must be forbidden or bound
It says that from any reachable marking Mthere must be possible to reach o in some steps
Fairness assumption:A task cannot be postponed indefinitely
OK
59
Soundness, FormallyA workflow net is called sound if
no dead task no transition is dead
8t 2 T. 9M 2 [ i i. M t!
option to complete place o is eventually marked
8M 2 [ i i. 9M 0 2 [M i. M 0(o) � 1
proper completion when o is marked, no other token is left
8M 2 [ i i. M(o) � 1 ) M = o
Dead, live or non-live
60
A remark about terminology:
t is dead = its firing is always ruled out
t is live = its firing can never be ruled out
t is non-live = its firing is possibly ruled out
1: no dead tasks
61
c14
start
t2c1
t1
t3c2 t4c3 t5c4 t6c5
c6
t7c7 t8c8
t9
c9
t11
c11
t12
c13
t13
c15
t14
c16
t15
c17
t16
c18
t10c10
c12
c20t17
t18
c22
t21 t21
t20
t19
c19
t22
c23
klaar
?
Reachable marking that enables the transition
1: no dead tasks
62
The check must be repeated for each task
2: option to complete
63
c14
start
t2c1
t1
t3c2 t4c3 t5c4 t6c5
c6
t7c7 t8c8
t9
c9
t11
c11
t12
c13
t13
c15
t14
c16
t15
c17
t16
c18
t10c10
c12
c20t17
t18
c22
t21 t21
t20
t19
c19
t22
c23
klaar
?
Able to produce one token in o
2: option to complete
64
The check must be repeated for each reachable marking
3: proper completion
65
c14
start
t2c1
t1
t3c2 t4c3 t5c4 t6c5
c6
t7c7 t8c8
t9
c9
t11
c11
t12
c13
t13
c15
t14
c16
t15
c17
t16
c18
t10c10
c12
c20t17
t18
c22
t21 t21
t20
t19
c19
t22
c23
klaar
?We should show that it is not a reachable marking
3: proper completion
66
The check must be repeated for each marking M such that M(o) ≥ 1
Brute-force analysis
67
First, check if the Petri net is a workflow net easy "syntactic" check
Second, check if it is sound (more difficult): build the Reachability Graph
to check 1: for each transition t there must be an arc in the RG that is labelled with t
to check 2&3: the RG must have only one final state (sink), that consists of one token in o
and is reachable from any other state, and no other marking has a token in o
Some Pragmatic Considerations
68
All checks can better be done automatically (computer aided)
but nevertheless RG construction... 1. can be computationally expensive for large nets
(because of state explosion) 2. provides little support in repairing unsound processes
3. can be infinite (CG can be used, but it is not exact)
Advanced support
69
Translate soundness to other well-known properties that can be checked more efficiently:
boundedness and liveness
N*
70
71
Business Process
i o
Play once
72
Business Process
i o
reset
Play twice
73
Business Process
i o
reset
Play any number of times
From N to N*
74
Strong connectedness of N*
75
Let us denote by N : i ! o a workflow net
with entry place i and exit place o.
Let N
⇤be the net obtained by adding the “reset” transition to N
reset : o ! i.
Proposition:
N
⇤is strongly connected.
Take two nodes of (x, y) 2 FN⇤,
we want to build a path from y to x
If x, y 6= reset , theny lies on a path i !⇤
y !⇤o, because N is a workflow net,
x lies on a path i !⇤x !⇤
o, because N is a workflow net,
we combine the paths y !⇤o ! reset ! i !⇤
x
Strong connectedness of N*
76
Let us denote by N : i ! o a workflow net
with entry place i and exit place o.
Let N
⇤be the net obtained by adding the “reset” transition to N
reset : o ! i.
Proposition:
N
⇤is strongly connected.
If x = o, y = reset , thentake any path i !⇤
o,we build the path reset ! i !⇤
o
Take two nodes of (x, y) 2 FN⇤,
we want to build a path from y to x
Strong connectedness of N*
77
Let us denote by N : i ! o a workflow net
with entry place i and exit place o.
Let N
⇤be the net obtained by adding the “reset” transition to N
reset : o ! i.
Proposition:
N
⇤is strongly connected.
Take two nodes of (x, y) 2 FN⇤,
we want to build a path from y to x
If x = reset , y = i, thentake any path i !⇤
o,we build the path i !⇤
o ! reset
MAIN THEOREM
78
Let us denote by N : i � o a workflow netwith entry place i and exit place o
Let N� be the net obtained by adding the ”reset” transition to Nreset : o � i
Theorem:N is sound i� N� is live and bounded
Proof of MAIN THEOREM (1)
79
N� live and bounded implies N sound:
Since N� is live: for each t ⌅ T there is M ⌅ [ i ⇧. M t⇤
Take any M ⌅ [ i ⇧ enabling reset : o ⇤ i, hence M ⇥ o
Let Mreset�⇤ M ⇥. Then M ⇥ ⌅ [ i ⇧ and M ⇥ ⇥ i
Since N� is bound, it must be M ⇥ = i (and M = o)Otherwise all places marked by M ⇥ � i = M � o would be unbounded
Hence N� just allows multiple runs of N :”option to complete” and ”proper completion” hold (see above)”no dead task” holds because N� is live
A technical lemma
80
Lemma:If N is sound, M is reachable in N i� M is reachable in N⇥
⌅) straightforward
⇤) Let i��⇥ M in N⇥ for � = t1t2...tn
We proceed by induction on the number r of instances of reset in �If r = 0, then reset does not occur in � and M is reachable in NIf r > 0, let k be the least index such that tk = resetLet � = �⇤tk�⇤⇤ with �⇤ = t1t2...tk�1 fireable in N
Since N is sound: i���⇥ o and i
����⇥ M
Since �⇤⇤ contains r � 1 instances of reset :by inductive hypothesis M is reachable in N
Proof of MAIN THEOREM (2)
81
N sound implies N� bounded :We proceed by contradiction, assuming N� is unbounded
Since N� is unbounded:⌃M,M ⇥ such that i ⇤� M ⇤� M ⇥ with M ⇥ M ⇥
Let L = M ⇥ �M ⇧= ⌥
Since N is sound:⌃� ⌅ T � such that M
�⇤ o
By the monotonicity Lemma: M ⇥ �⇤ o+ L and thus o+ L ⌅ [ i �Which is absurd, because N is sound
Proof of MAIN THEOREM (3)
82
N sound implies N� live:Take any transition t and let M be a marking reachable in N�
By the technical lemma, M is reachable in N
Since N is sound: ⌅� ⇤ T � with M��⇥ o
Since N is sound: ⌅�⇥ ⇤ T � with i���⇥ M ⇥ and M ⇥ t⇥
Let �⇥⇥ = � reset �⇥, then:
M����⇥ M ⇥ in N� and M ⇥ t⇥
http://woped.dhbw-karlsruhe.de/woped/
WoPeD (3.6.0)
Exercise
84
Use some tools to check if the net below is a sound workflow net or not
Exercise
85
Use some tools to check if the net below is a sound workflow net or not
Exercise
86
Analyse the following net