82acfd88f314811ed561a569f07af864.ppt

- Количество слайдов: 69

Dresden Dec. 12, 2016 GK Rosi Soundness preserving composition of workflows Theory of Programming Wolfgang Reisig Prof. Dr. W. Reisig 1

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 This talk: deling havior Mo Be ling • Smart ition Mode pos Smart Com • ion clic extens • The cy ta … Include da • 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

1. 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. 5

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, 7 final marking: 1 token on each p N*.

global WF net N: restaurant stretched. WF net: restaurant 1 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*. 2

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 10

inner(N) Lemma: Let N be an open WF net. Then inner(N) is a global WF net 11

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) 12

Internet Shopping ib choos e produ ct send order rec. produ ct accept produ ct return prod. fb 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) 13

not sound ib choos e produ ct send order rec. produ ct accept produ ct fb return prod. Def. : Let N be a global WF net. time out 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) 14

because ib choos e produ ct send order rec. produ ct accept produ ct fb return prod. Def. : Let N be a global WF net. time out 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) 15

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 $ $ Co Su $ Ma $ Di $ Cu no bracke ts! 17

an analogy: adapter $ $ socket $ adapter $ plug 18

( an analogy: adapter $ $ ) socket $ adapter $ plugo brack n ets! 19

a naïve composition operator T b a a b c b S c U | = S$ $ (T U) T b a a b S (S $ T) U $ c b c U not ciative asso 20

… 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 RM $ Su $ Ma $ Di $ C u $ Co provider and requester The interface of a component S producer and consumer is partitioned buy side and sell side into a left and a right port *S and S* ! predecessor and successor Central idea: Exploit this observation! 23

left and right port a S b c d f T b e d b e f U b e right left right port T* port *T port S* The interface of a component S is partitioned into a left and a right port *S and S* ! Central idea: Exploit this observation! b e For S $ T, compose S* with *T. 24

composition along ports a S b c d f T b e d b e f U b e (S $ T) $ U The interface of a component S is partitioned into a left and a right port *S and S* ! Central idea: Exploit this observation! b e For S $ T, compose S* with *T. 25

… is associative! a S b c d f T b e d b e f U b e (S $ T) $ = S$ $ (T U U) The interface of a component S is partitioned into a left and a right port *S and S* ! Central idea: Exploit this observation! b e For S $ T, compose S* with *T. 26

2. 3 Index labelled composition

in case a* and *b fit perfectly a b B A *a D C C a* F b *b E b* The two “C” labelled places are matching. The two “D” labelled places are matching. 28

composition a$b a $ b B A * (a$b ) D a C F b E (a$ b)* 29

… it is not always that simple b a G B A *a D C C a* F b *b E a* The two “C” labelled places are matching. The two “D” labelled places are matching. 30

… it is not always that simple a C 1 $ b G D B A a L 1 *(a$b) C F b E R 2 (a$ b)* 31

this works nicely: b a B A *a D G a C a* C C F b *b E b* The two “C” labelled places are matching. 32

… unfortunately b a E B A *a D C C a* F b *b E b* The two “C” labelled places are matching. The two “D” labelled places are matching. 33

… unfortunately C 1 a$b C 2 E D B A a C L 1 *(a$b) Two nodes of (a$b)* are labelled alike! F b E R 2 (a$b)* You can not avoid this! 34

… what to do here ? ? ? b a B A *a D C a ? C C a* D 2 Idea: 1 index labelling: n equally labelled nodes in one port are indexed 1, … n. *b F b E b* graphical convention: lower < upper. Glue equally labelled and equally indexed nodes. 35

… what to do here ? ? ? b a B A *a D D C a C C a* 2 Idea: 1 index labelling: n equally labelled nodes in one port are indexed 1, … n. *b F b E b* graphical convention: lower < upper. Glue equally labelled and equally indexed nodes. 36

an extreme case b a A A A *a A A a 2 A 3 A a* 2 *b 1 1 b 2 1 A b* 1 all labels alike. 37

an extreme case b a A A A *a A A a 2 A 3 A a* 2 *b 1 1 b 2 1 A b* 1 all labels alike. 38

an extreme case C 1 a$b C 2 A A D A A a A C L 1 *(a$b) 2 1 b A R 2 (a$b) * 2 1 all labels alike. 39

… another extreme case B A F D a E C all labels different. H b G H F E results in b G B a D A C 40

The associativity 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, the left port initial marking: 1 token on each p *N. - set N* of stop places, the right port final marking: 1 token on each p N*. index labelled

add a workflow, N a global, sound seller ib choos e produ ct send order rec. produ ct accept produ ct fb return prod. time out rec. returne d prod. is rec. order send product file recor d handle fs 43

… a reachable state … ib choos e produ ct send order rec. produ ct fb return prod. buyer may want to continue … is accept produ ct time out rec. returne d prod. rec. order send product file recor d handle fs 44

second purchase, N$N ib choos e produ ct send order accept produ ct fb return prod. time out rec. returne d prod. file recor d handle fs 45

second purchase ib choos e produ ct send order accept produ ct fb return prod. time out rec. returne d prod. file recor d handle fs 46

second purchase accept produ ct fb ib choos e produ ct send order rec. produ ct accep produ ct return prod. re p time out rec. returne d prod. file recor d r ret dp handle fs is rec. order send product 47 file recor d

N$N is a sound WF net, too! N: ib choos e produ ct send order rec. produ ct accept produ ct fb return prod. time out rec. returne d prod. is rec. order send product file recor d handle fs 48

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 the left port the right port Def. : open WF net N: - set *N of places and transitions, subset of places start. N *N, initial marking: 1 token on each p start. N. - set N* of places and transitions, subset of places stop. N *N, final marking: 1 token on each p stop. N. Observation: An open WF net N is a global WF net iff *N = start. N and N* = stop. N.

Example: Client and seller client subscripti on obtain product order subscripti on produ ct collect receive pa y send cas h

… not what we wanted client order receive seller subscripti on obtain produ ct collect send pay cas h Deadlock!!

Adapting required behaviour bank client order receive seller subscripti on obtain produ ct collect send pay cas h

associativity required! bank client order receive seller subscripti on obtain produ ct collect send pay cas h

More liberal composition 55

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 a ac *a a* B D B C D B B B A a Idea: To construct ac, compose a* with *a just as you compose a* with some *b. a B B 58

N N: *N ib remember: Seller and buyer the Always ready-seller choos e produ ct send order rec. produ ct accept produ ct fb N* Def. : global WF net N: - set *N of start places, return prod. initial marking: 1 token on each p *N. M with internal init time - set N* of stop places, - set M of inner places out final marking: 1 token on each p N*. M rec. returne Observations. handle d prod. • Each conventional open WF net M is an open WF net with M = ; as internal init. ii. Let N and M be rec. WF nets with internal init. open file send fs is recor product order N$M is an open WF net with internal init. d 59

Nc N: *(Nc) ib remember: Seller and buyer the Always ready-seller, Nc choos e produ ct send order rec. produ ct accept produ ct fb (Nc)* Def. : global WF net N: - set *N of start places, return prod. initial marking: 1 token on each p *N. MN Closure Nc of a time - set N* of stop places, Let MN be the “matching” out places of N* and *N. final marking: 1 token on each p N*. MN rec. returne MN is handle Observation: Let N be a global WF net with internal init. d prod. Then Nc is a global workflow net with internal init. rec. order send product file recor d fs is 60

remember: Soundness Def. : Let N be a global WF net. with internal init, M. N is sound iff • no arc goes out of N* ; M M • starting from *N, each transition can be enabled ; • From each reachable marking M, the marking N* is reachable. • No marking K > N* is reachable. M Theorem: Let N and M be sound global Wf nets with initial init. i. N$M is sound. ii. Nc is sound. 61

Nc global WF net: restaurant 1 2 *N ={C 1, C 2, Wf} *(Nc) ={C 1, C 2} N* ={e 1, e 2, Wf} (Nc)* ={e 1, e 2}

4. Include data …

data processing open WF nets the juice partner: x! = x= coin order x! x! x beverage x! 64

Distinguishable tokens the tea partner: x! = x= coin order x! x! x beverage x! 65

The Mc. Donald’s vending machine x =. . . coin order x! x! x beverage x! 66

summing up: How to use all this … 1. Start modelling your system by small data processing sound open WF nets; 2. compose them; You get a sound system model for free!

SOAMED Vorlesung 5. Dez. 2016 Soundness preserving composition of workflows Wolfgang Reisig it with do obal , gl sound w orkflo w nets! Theory of Programming Prof. Dr. W. Reisig 68

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.