Lezione 14 Model Transformations for BP Analysis and Execution

52
1 1 Ingegneria dei Processi Aziendali Modulo 1 - Servizi Web Unità didattica 1 – Protocolli Web Ernesto Damiani Università di Milano Lezione 14 – Model Transformations for BP Analysis and Execution

Transcript of Lezione 14 Model Transformations for BP Analysis and Execution

Page 1: Lezione 14 Model Transformations for BP Analysis and Execution

1

1

Ingegneria dei Processi Aziendali

Modulo 1 - Servizi Web

Unità didattica 1 – Protocolli Web

Ernesto Damiani

Università di Milano

Lezione 14 – Model Transformations for BP Analysis and Execution

Page 2: Lezione 14 Model Transformations for BP Analysis and Execution

2

2

Business Process Management (BPM)

Collection of methods and techniques to

design, analyze, execute and monitor business

operations involving humans, software,

information and physical artifacts using

process models.

Page 3: Lezione 14 Model Transformations for BP Analysis and Execution

3

3

OK, so what is a process model?

Collection of inter-dependent activities whose collective performance is intended to achieve a goal such as delivering a product or a service.

E,g. order-to-cash, procure-to-pay, issue-to-resolution

Check

Completeness

Obtain

Additional

Information

Check Credit

History

Check Income

Source(s)

Credit Card

Application

Assess

Application

Make Credit

Offer

Notify

Rejection

Page 4: Lezione 14 Model Transformations for BP Analysis and Execution

4

4

Process models serve many purposes…

Process

Documentation

Workflow

Management

Enterprise

Architecture Document

Management

Knowledge

Management

Process

Improvement

Process Cost

Analysis / Simulation Enterprise

Systems

Compliance /

Risk Management

Software

Evaluation/

Selection

Page 5: Lezione 14 Model Transformations for BP Analysis and Execution

5

5

… they have many faces

Process

Implementation

Process

Analysis & Design

Process

Enactment &

Monitoring

Process

Evaluation

“TO BE”

Process Models

Ex

ec

uta

ble

Pro

ce

ss

Mo

de

ls

Me

as

ure

s f

or

Imp

rov

em

en

t

Process

Metrics

Organizational

Analysis

Ta

rge

t V

alu

es

“AS IS”

Process

Models

Abstract Models

EPC, BPMN

Communication,

simulation, activity-

based costing…

Detailed Models

BPEL, State Machines…

Data types, conditions, data

mappings, fault handling…

Integration, testing,

deployment…

Page 6: Lezione 14 Model Transformations for BP Analysis and Execution

6

6

…and can be seen from many perspectives

Control-flow

Data

Resource

Operational

Sound design

Dialog premix FX premix

Music designComposer

Sound Designer

Editor

V

V

Temp picture cut

Temp picture cut

V

V

V

V

Temp music output

Temp sound output

Effect cues Dialog cues Music cues

Page 7: Lezione 14 Model Transformations for BP Analysis and Execution

7

7

Many in one, or one in many?

“The thing can be many in one sense, but

also can be one in another sense.”

Imam Ghazali

Revival of Religious Sciences

Page 8: Lezione 14 Model Transformations for BP Analysis and Execution

8

8

Process Modelling: Dealing with Multiplicity

Multiple modelling languages (meta-models)

Multiple modelling viewpoints

• Control-flow view vs. data view

• Public views (protocols) vs. private views

Multiple abstraction levels

• High-level: tasks, performance metrics...

• Low-level: data transformations, application bindings...

Page 9: Lezione 14 Model Transformations for BP Analysis and Execution

9

9

Process Modelling Notations

• Business Process Modelling Notation

(BPMN)

• Event-driven Process Chains (EPC)

• Business Process Execution Language

(BPEL)

• State machines and variants (e.g. IBM

Business State Machine, WWF)

• Petri nets (and variants, e.g. YAWL)

Page 10: Lezione 14 Model Transformations for BP Analysis and Execution

10

10

Model transformations

BPMN-to-BPEL

• Purpose: Transform models produced by analysts into models for developers (and vice-versa)

• Commonly supported in commercial tool, but in a limited manner

BPEL-to-Petri nets

• For analysis & verification

BPMN-to-Petri nets

• For analysis & verification (e.g. deadlock-freeness)

Page 11: Lezione 14 Model Transformations for BP Analysis and Execution

11

11

BPMN from 10 000 miles…

Event Task Flow Gateway

Page 12: Lezione 14 Model Transformations for BP Analysis and Execution

12

12

BPMN: A more detailed view

Start EventIntermediate

Message EventIntermediate Timer Event

Task Parallel Fork Gateway

Parallel Join Gateway

End Terminate EventEnd Event

Flow Event-based Decision Gateway

receive

Merge Gateway

Data-based Decision Gateway

c

~c

Page 13: Lezione 14 Model Transformations for BP Analysis and Execution

13

13

Quick BPMN example

Check stock

availability

Reject order

Confirm order

Send invoice

Ship goods

Page 14: Lezione 14 Model Transformations for BP Analysis and Execution

14

14

BPEL from 10 000 miles

Basic activities: <assign>, <invoke>,

<receive>

Sequential flow: <sequence>, <while>,

<switch>

Block-structured parallel flow: <flow>

Graph-oriented (parallel) flow: <link> **

Event-action rules: <onEvent> **

Other constructs not relevant to this talk…

** Only partially supported by some tools

Page 15: Lezione 14 Model Transformations for BP Analysis and Execution

15

15

A quick BPEL example

<sequence>

<invoke “check stock availability” …/>

<switch (…) …/>

<case “reject”> <invoke “order rejection” …/> </case>

<otherwise>

<sequence>

<invoke “order acceptance” … />

<flow> <invoke “invoicing” … />

<invoke “ship goods” … />

</flow>

</sequence> </otherwise> </switch> </sequence>

Page 16: Lezione 14 Model Transformations for BP Analysis and Execution

16

16

BPMN-to-BPEL: Some monsters!

Bounded multiple-

instance task (D)Unstructured loop

LivelockUnbounded multiple-

instance tasks (C)

A B C D

A B C D

A D

A

B

C

D

Page 17: Lezione 14 Model Transformations for BP Analysis and Execution

17

17

BPMN-to-BPEL (from 10 000 miles)

Repeat until reduction to a single node

1. Identify a structured & quasi-structured SESE region

Fold into a BPEL structured activity

2. Identify irreducible SESE regions without parallelism

Apply GotoWhile transformations, repeat from 1

3. Identify acyclic fragments with concurrency

Fold into a BPEL activity with control links

4. Identify minimal unstructured components

BPEL event handlers

Page 18: Lezione 14 Model Transformations for BP Analysis and Execution

18

18

BPMN-BPEL: Structured Components

( a ) SEQUENCE-component

( b ) FLOW-component

<sequence> <invoke name="t1"/> <receive name="e1"/> . . . <invoke name="tn"/></sequence>

tc

<flow> <invoke name="t1"/> <wait name="e2"/> . . . <invoke name="tn"/></flow>

tc

t1

e1

tn

t1

tn

e2

C

C

Page 19: Lezione 14 Model Transformations for BP Analysis and Execution

19

19

BPMN-BPEL: Structured Components

( e ) WHILE-component

( f ) REPEAT-component

<while condition="c1"> <invoke name="t1"/></while>

tc

<sequence> <invoke name="t1"/> <while condition="c1"> <invoke name="t1"/> </while></sequence>

tc

c1

~c1

t1

C

c1

~c1t1

C

Page 20: Lezione 14 Model Transformations for BP Analysis and Execution

20

20

BPMN-BPEL: Structured Components

( c ) SWITCH-component

( d ) PICK-component

<switch> <case condition="c1"> <invoke name="t1"/> </case> <case condition="c2"> <receive name="e1"/> </case> . . . <otherwise> <empty/> </otherwise></switch>

tc

tc

<pick> <onMessage name="e1"/> <invoke name="t1"/> </onMessage> <onAlarm name="e2"> <empty/> </onAlarm> . . . <onMessage name="tr"> <invoke name="tn"/> </onMessage></pick>

tn

t1

tr(receive)

e1

e2

C

t1

c2

default

c1

e1

C

Page 21: Lezione 14 Model Transformations for BP Analysis and Execution

21

21

Example: Only Structured Components

Check stock

availability

Reject order

Confirm order

Send invoice

Ship goods

Flow-component

Switch-component

Sequence-component

Sequence-component

Page 22: Lezione 14 Model Transformations for BP Analysis and Execution

22

22

BPMN-to-BPEL: Acyclic component

T1

T2

T3

T4

T1 T3

T2 T4

Flow-component

AND

BPMN BPEL

Proposition: Every acyclic BPMN component

with a single entry point and a single exit

point that is 1-safe and sound can be

mapped to a BPEL Flow with links

Page 23: Lezione 14 Model Transformations for BP Analysis and Execution

23

23

Example Structured+Acyclic Components

a2

C1

f2

f3

m4

UBL

receive EDI 856

(ASN)

receive EDI 810

(Invoice)

receive

despatch-advice

receive invoice

EDI

send

payment-request

send

fulfillment-notice

a1

a4

a3

a5

a6

d1

m5

j6

tc1 send

fulfillment-notice

a6C2

tc2

Page 24: Lezione 14 Model Transformations for BP Analysis and Execution

24

24

Minimizing the use of control links

a1

a3

a2

a5

a4

a6

a7

a8

fc

jc

g2

g1

g3

g4

g5

t1

a5

a7

t2

t3

g4

jc

fc

[a3, a4]

[a1, a2]

[a6, a8]

Page 25: Lezione 14 Model Transformations for BP Analysis and Execution

25

25

For the rest…

Identify a minimal SESE region that is neither structured nor acyclic

For each action in the component, retrieve:

• All actions that immediately precede it

• All actions that immediately follow it

For each action, code the following behaviour using event-action rules:

• Wait for a suitable combination of predecessors to complete

• Perform action

• Notify completion to all successors

Page 26: Lezione 14 Model Transformations for BP Analysis and Execution

26

26

BPEL-to-Petri net Application to Conformance Checking

Services

Services abstract

BPEL

process

Petri net

model

SOAP

Messages

Event Log

Services

Monitoring /

Correlation

Conformance?

Conformance

Checking!

Translation

Page 27: Lezione 14 Model Transformations for BP Analysis and Execution

27

27

From BPEL to WF-nets

Page 28: Lezione 14 Model Transformations for BP Analysis and Execution

28

28

Petri net-based Conformance Checking

Objectives:

• quantitatively measure conformance

• locate deviations

Conformance?

Page 29: Lezione 14 Model Transformations for BP Analysis and Execution

29

29

Conformance Checking – Fitness

Page 30: Lezione 14 Model Transformations for BP Analysis and Execution

30

30

Conformance Checking – Fitness

Page 31: Lezione 14 Model Transformations for BP Analysis and Execution

31

31

Measuring fitness: Log replay analysis

missing tokens

remaining tokens = 0

= 1

consumed tokens

produced tokens = 0

= 0

Page 32: Lezione 14 Model Transformations for BP Analysis and Execution

32

32

Measuring fitness: Log replay analysis

= 1

= 2

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 33: Lezione 14 Model Transformations for BP Analysis and Execution

33

33

Measuring fitness: Log replay analysis

= 2

= 4

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 34: Lezione 14 Model Transformations for BP Analysis and Execution

34

34

Measuring fitness: Log replay analysis

= 3

= 5

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 35: Lezione 14 Model Transformations for BP Analysis and Execution

35

35

Measuring fitness: Log replay analysis

= 5

= 6

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 36: Lezione 14 Model Transformations for BP Analysis and Execution

36

36

Measuring fitness: Log replay analysis

= 6

= 7

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 37: Lezione 14 Model Transformations for BP Analysis and Execution

37

37

Measuring fitness: Log replay analysis

= 7

= 7

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 38: Lezione 14 Model Transformations for BP Analysis and Execution

38

38

Measuring fitness: Log replay analysis

= 9

= 9

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 39: Lezione 14 Model Transformations for BP Analysis and Execution

39

39

Measuring fitness: Log replay analysis

= 9

= 9

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 40: Lezione 14 Model Transformations for BP Analysis and Execution

40

40

Measuring fitness: Log replay analysis

= 0

= 1

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 41: Lezione 14 Model Transformations for BP Analysis and Execution

41

41

Measuring fitness: Log replay analysis

= 1

= 2

= 0

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 42: Lezione 14 Model Transformations for BP Analysis and Execution

42

42

Measuring fitness: Log replay analysis

= 2

= 4

= 1

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 43: Lezione 14 Model Transformations for BP Analysis and Execution

43

43

Measuring fitness: Log replay analysis

= 3

= 5

= 1

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 44: Lezione 14 Model Transformations for BP Analysis and Execution

44

44

Measuring fitness: Log replay analysis

= 4

= 6

= 1

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 45: Lezione 14 Model Transformations for BP Analysis and Execution

45

45

Measuring fitness: Log replay analysis

= 6

= 7

= 1

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 46: Lezione 14 Model Transformations for BP Analysis and Execution

46

46

Measuring fitness: Log replay analysis

= 7

= 8

= 1

= 0

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 47: Lezione 14 Model Transformations for BP Analysis and Execution

47

47

Measuring fitness: Log replay analysis

= 8

= 8

= 1

= 1

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 48: Lezione 14 Model Transformations for BP Analysis and Execution

48

48

Measuring fitness: Log replay analysis

= 8

= 8

= 1

= 1

missing tokens

remaining tokens

consumed tokens

produced tokens

Page 49: Lezione 14 Model Transformations for BP Analysis and Execution

49

49

Measuring fitness: Log replay analysis

Page 50: Lezione 14 Model Transformations for BP Analysis and Execution

50

50

Measuring fitness: Log replay analysis

f = 1.0 f ≈ 0.540 f ≈ 0.955

Page 51: Lezione 14 Model Transformations for BP Analysis and Execution

51

51

Conformance Checking - Appropriateness

100 % fitness

but not sufficiently

specific from

behavioral point of view.

100 % fitness

but not represented in

structurally suitable way.

Page 52: Lezione 14 Model Transformations for BP Analysis and Execution

52

52

Ongoing work

Reversible BPMN ↔ BPEL transformation

Two-way transformation: BPEL ↔ FSM

• Application to automated service composition

• BPEL FSM not too difficult

• FSM BPEL more exciting, e.g.

A

B

B

A

A

BFINE