composition of workflows Dresden Dec.12, 2016 GK Rosi Soundness preserving composition of workflows Theory of Programming Prof. Dr. W. Reisig Wolfgang Reisig
Background Each large system is made of components (workflows, services, … ) A component has a behavior has an interface, interface is used to communicate with other components A component model describes behavior as steps, describes the interface as a set of – whatever – elements models communication by composition, i.e “glueing” corresponding interface elements of components This talk: Smart Behavior Modeling Smart Composition Modeling The cyclic extension Include data …
Smart Behavior modeling … using Workflow Nets 1.1 Classes of Workflow Nets 1.2 Sound Workflow Nets
1.1 Classes of Workflow Nets local ~ global ~ open ~
local WF net: A buyer Def.: local WF net: - one start place, p; Initial marking: 1 token on p. - one stop place, q; Final marking: 1 token on q.
local WF net: credit based shopping
global WF net: Buyer and seller goods I Def.: global WF net N: - set *N of start places, initial marking: 1 token on each p *N . - set N* of stop places, final marking: 1 token on each p N* .
stretched WF net N: restaurant 2 1 global WF net: restaurant stretched WF net N: restaurant Def.: global WF net N: - set *N of start places, initial marking: 1 token on each p *N . - set N* of stop places, final marking: 1 token on each p N* .
Observations let N be global. i. N is local iff |*N| = |N*| = 1 ii. N can easily be made local: Later we see: no good idea upon composition
Open WF nets Def.: later
inner(N) Lemma: Let N be an open WF net. Then inner(N) is a global WF net
1.2 Sound workflow nets sound! Def.: Let N be a global WF net. N is sound iff no arc goes out of N* ; starting from *N, each transition can be enabled ; From each reachable marking M, the marking N* is reachable. No marking M > N* is reachable. Soundness is efficiently decidable. (v.d. Aalst)
Internet Shopping sound! Def.: Let N be a global WF net. choose product send order rec. product accept product ib fb return prod. sound! Def.: Let N be a global WF net. N is sound iff no arc goes out of N* ; starting from *N, each transition can be enabled ; From each reachable marking M, the marking N* is reachable. No marking M > N* is reachable. Soundness is efficiently decidable. (v.d. Aalst)
not sound Def.: Let N be a global WF net. N is sound iff choose product send order rec. product accept product ib fb time out return prod. Def.: Let N be a global WF net. N is sound iff no arc goes out of N* ; starting from *N, each transition can be enabled ; From each reachable marking M, the marking N* is reachable. No marking M > N* is reachable. Soundness is efficiently decidable. (v.d. Aalst)
because Def.: Let N be a global WF net. N is sound iff choose product send order rec. product accept product ib fb time out return prod. Def.: Let N be a global WF net. N is sound iff no arc goes out of N* ; starting from *N, each transition can be enabled ; From each reachable marking M, the marking N* is reachable. No marking M > N* is reachable. Soundness is efficiently decidable. (v.d. Aalst)
2. Smart Composition Modeling 2.1 The problem of associative composition 2.2 Left and right port 2.3 Index labelling of a port 2.4 Composition of global WF nets 2.5 Composition of open WF nets
2.1 The problem of associative comp. Example: a supply chain composition of business processes RM $ Su $ Ma $ Di $ Cu $ Co no brackets!
an analogy: adapter $ $ socket $ adapter $ plug
an analogy: adapter $ $ ( ) socket $ adapter $ plug no brackets!
a naïve composition operator (S $ T) $ U a b c a b b c S U = | S $ (T $ U) T a b c U S not associative
… summing up On the set of component models, composition should be total associative
2.2 Left and right port On the set of component models, composition should be total associative
A fundamental observation $ typical left/right ports: start and stop input and output customer and supplier provider and requester producer and consumer buy side and sell side predecessor and successor RM $ Su $ Ma $ Di $ C u $ Co The interface of a component S is partitioned into a left and a right port *S and S* ! Central idea: Exploit this observation!
left and right port S right port T* right port S* T U left port *T b c right port T* right port S* T b e d f U b e d f left port *T The interface of a component S is partitioned into a left and a right port *S and S* ! For S $ T, compose S* with *T . Central idea: Exploit this observation!
composition along ports b c T b e d f U b e d f (S $ T) $ U The interface of a component S is partitioned into a left and a right port *S and S* ! For S $ T, compose S* with *T . Central idea: Exploit this observation!
… is associative! = S T U (S $ T) $ U S $ (T $ U) b c T b e d f U b e d f (S $ T) $ U = S $ (T $ U) The interface of a component S is partitioned into a left and a right port *S and S* ! For S $ T, compose S* with *T . Central idea: Exploit this observation!
2.3 Index labelled composition
in case a* and *b fit perfectly The two “C” labelled places are matching. The two “D” labelled places are matching.
composition a$b a$b B D D F a b A C C E * (a$b) (a$b)*
… it is not always that simple *b b E D C F G B D a A C *a a* The two “C” labelled places are matching. The two “D” labelled places are matching.
… it is not always that simple a$b C1 G B D D F a b A C C E L1 R2 *(a$b) (a$b)*
this works nicely: C a b B D G F a b A C C E *a a* *b b* The two “C” labelled places are matching.
… unfortunately a b* *b b E D C F E B D a A C *a a* The two “C” labelled places are matching. The two “D” labelled places are matching.
… unfortunately a$b C1 C2 E B D D F a b A C C E R2 *(a$b) L1 (a$b)* Two nodes of (a$b)* are labelled alike! You can not avoid this!
… what to do here ??? ? a b B D D F C a b A C C E *a a* 1 2 *b b* Idea: index labelling: n equally labelled nodes in one port are indexed 1, … n . graphical convention: lower < upper. Glue equally labelled and equally indexed nodes.
… what to do here ??? a b B D C D F a b A C C E *a a* 1 2 *b b* Idea: index labelling: n equally labelled nodes in one port are indexed 1, … n . graphical convention: lower < upper. Glue equally labelled and equally indexed nodes.
an extreme case a b* *b b A A A A a A 1 2 3 A *a 1 2 a* 1 2 1 all labels alike.
an extreme case a b* *b b A 1 A A A a A 1 2 3 A *a 1 2 a* 1 2 all labels alike.
an extreme case a$b C1 C2 A A D A a b 2 A A C A R2 *(a$b) L1 1 2 all labels alike.
… another extreme case B F D D H a b A E C G C B A D b a G F E H all labels different. results in
The associativity Theorem Theorem: Index labelled composition is associative.
2.4 Composition of global WF nets index labelled remember: Def.: global WF net N: - set *N of start places, initial marking: 1 token on each p *N . - set N* of stop places, final marking: 1 token on each p N* . the left port the right port index labelled
a global, sound workflow, N add a seller choose product send order rec. product accept product ib fb time out return prod. rec. returned prod. handle rec. order send product file record is fs
… a reachable state … buyer may want to continue … choose product send order rec. product accept product ib fb return prod. buyer may want to continue … time out rec. returned prod. handle rec. order send product file record is fs
second purchase, N$N choose product send order ib rec. returned prod. handle return prod. time out accept product fb file record fs
second purchase choose product send order ib rec. returned prod. handle return prod. time out accept product fb file record fs
second purchase rec. returned prod. handle return prod. time out accept product fb file record fs rec. product accept product fb return prod. time out rec. returned prod. handle file record send product rec. order is fs choose product send order ib
N$N is a sound WF net, too! N: choose product send order rec. product accept product ib fb time out return prod. rec. returned prod. handle rec. order send product file record is fs
Properties Let N and M be global WF nets. Observation: N$M is a global WF net. Theorem 1. N$M is sound iff both N and M are sound.
2.5 Open WF nets composition Def.: open WF net N: - set *N of places and transitions, subset of places startN *N, initial marking: 1 token on each p startN . set N* of places and transitions, subset of places stopN *N, final marking: 1 token on each p stopN . the left port the right port Observation: An open WF net N is a global WF net iff *N = startN and N* = stopN .
Example: Client and seller order receive pay seller obtain collect send subscription product cash subscription product cash
… not what we wanted Deadlock!! client seller order receive pay obtain collect send subscription product cash Deadlock!!
Adapting required behaviour client order receive pay bank subscription product cash seller obtain collect send subscription product cash subscription product cash
associativity required! client order receive pay subscription product cash bank subscription product cash seller obtain collect send subscription product cash
More liberal compo- sition
Composed business processes
Properties Observation. Let N and M be open WF nets. Then N$M is an open WF net. … no compositional behavior
3. The cyclic extension ac B A D a C B a D B C B A Idea: To construct ac, compose a* with *a just as you compose a* with some *b .
remember: Seller and buyer the Always ready-seller N: N choose product send order rec. product accept product ib fb *N N* time out return prod. Def.: global WF net N: - set *N of start places, initial marking: 1 token on each p *N . - set N* of stop places, final marking: 1 token on each p N* . with internal init M - set M of inner places M rec. returned prod. handle Observations. Each conventional open WF net is an open WF net with M = ; as internal init . ii. Let N and M be open WF nets with internal init. N$M is an open WF net with internal init. M rec. order send product file record is fs
remember: Seller and buyer the Always ready-seller, Nc Nc N: choose product send order rec. product accept product ib fb *(Nc) (Nc)* time out return prod. Def.: global WF net N: - set *N of start places, initial marking: 1 token on each p *N . - set N* of stop places, final marking: 1 token on each p N* . Closure Nc of a MN Let MN be the “matching” places of N* and *N. MN rec. returned prod. handle Observation: Let N be a global WF net with internal init. Then Nc is a global workflow net with internal init. MN rec. order send product file record is fs is
remember: Soundness Def.: Let N be a global WF net. N is sound iff no arc goes out of N* ; starting from *N, each transition can be enabled ; From each reachable marking M, the marking N* is reachable. No marking K > N* is reachable. with internal init, M. M M M Theorem: Let N and M be sound global Wf nets with initial init. i. N$M is sound. ii. Nc is sound.
global WF net: restaurant 2 1 N Nc *N ={C1, C2, Wf} *(Nc) ={C1, C2} N* ={e1, e2, Wf} (Nc)* ={e1, e2}
4. Include data …
data processing open WF nets x! = x = the juice partner: coin beverage coin x! beverage x order order
Distinguishable tokens x! = x = the tea partner: coin beverage coin x! beverage x order order
The McDonald’s vending machine x = ... coin x! beverage x order
summing up: How to use all this … Start modelling your system by small data processing sound open WF nets; compose them; You get a sound system model for free!
composition of workflows SOAMED Vorlesung 5. Dez. 2016 Soundness preserving composition of workflows do it with global , sound workflow nets! Theory of Programming Prof. Dr. W. Reisig Wolfgang Reisig
Soundness preserving composition of workflows A large computer embedded system or business process is usually composed of interacting components. A component may be organized as a workflow. A workflow is a pattern, describing a set of events, to be executed in a “before-after”-relation, or independent form one another, or alternatively. A large workflow may be composed from smaller ones. A reasonable workflow W is sound: W has a unique initial and a unique terminal state; to every event e of W there exists a sequence of event executions that includes e; W can always reach its terminal state, and upon termination, no “garbage” remains. Soundness of (Petri net models of) workflows is efficiently decidable. We present a most liberal composition operator for workflows that preserves soundness (i.e. composition of two sound workflows is a sound workflow again). This allows to stay in the world of sound workflows during the construction of large workflows and business processes.