Christian gierds 2013-06-20-c ai-se

14
Analyzing and Completing Middleware Designs for Enterprise Integration using Coloured Petri Nets Dirk Fahland, Christian Gierds Loan Broker Customer Bank 2 Bank 1 Bank 3 Credit Bureau Loan Broker Get Credit Score Get Banks Credit Bureau Rule Base Recipient List Aggregator Bank 2 Bank 1 Bank 3 Loan Request Best Quote Simulation Model Checking Completion Execution

Transcript of Christian gierds 2013-06-20-c ai-se

Page 1: Christian gierds 2013-06-20-c ai-se

Analyzing and Completing Middleware Designs forEnterprise Integration using Coloured Petri Nets

Dirk Fahland, Christian Gierds

Loan BrokerCustomer Bank 2

Bank 1

Bank 3Credit Bureau

Loan Broker

Get Credit Score Get Banks

Credit Bureau Rule Base

Recipient List

Aggregator

Bank 2

Bank 1

Bank 3

Loan Request

Best Quote

Simulation

Model Checking

Completion

Execution

Page 2: Christian gierds 2013-06-20-c ai-se

Enterprise Integration Patterns

• by Gregor Hohpe & Bobby Woolf

• high-level integrationpatterns

• focus on messages• collection of best

practices

Enterprise Integration

2

Page 3: Christian gierds 2013-06-20-c ai-se

Implementing a Middleware

Hohpe & Woolf:1. model middleware with Enterprise

Integration Patterns (EIP)2. implement (each EIP)

Enterprise Integration

3

Loan BrokerCustomer Bank 2

Bank 1

Bank 3Credit Bureau

Loan Broker

Get Credit Score Get Banks

Credit Bureau Rule Base

Recipient List

Aggregator

Bank 2

Bank 1

Bank 3

Loan Request

Best Quote

Page 4: Christian gierds 2013-06-20-c ai-se

Middleware Design with EIP

Advantages:• model-driven design• structured approach

Enterprise Integration

4

Gaps:• informal description of

patterns• no analysis of model• no check of interplay of

patterns

Page 5: Christian gierds 2013-06-20-c ai-se

Translate EIP to Formal ModelEnterprise Integration

5

Loan Broker

Get Credit Score Get Banks

Credit Bureau Rule Base

Recipient List

Aggregator

Bank 2

Bank 1

Bank 3

Loan Request

Best Quote

data

Loan Request Get Credit Score Get Banks

Best Quote

Recipient List

Aggegator

cond1 pipe1

pipe2cond2

cond3 pipe3

["pipe1" ∈ l]

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

y

y

y

condi

(y,l) ["pipei" ∉ l]x x x

req x

x z y l

z

enrich x z y y y

req y

l

(y,l)

pipefirstdata

[isFirst q]

q

aggr.update b q

b[isComplete b]

data

[canUpdate q b]

q

f qbb

y

y

y

q

Banks

["pipe2" ∈ l]

["pipe3" ∈ l]

var x : LoanRequest;var y : ScoredLoanRequest;var z : CreditScore;var l : ListOfBanks;var q, b : Quote;

fun req x = …;fun req y = …;fun isFirst q = …;fun canUpdate q b = …;fun update b q = …;fun isComplete b = …;fun f q = …;

Simulation

Model Checking

Completion

Execution

Issues:• overall correctness• throughput of each

pattern• control-flow

dependencies

Page 6: Christian gierds 2013-06-20-c ai-se

NextEnterprise Integration

6

Loan Broker

Get Credit Score Get Banks

Credit Bureau Rule Base

Recipient List

Aggregator

Bank 2

Bank 1

Bank 3

Loan Request

Best Quote

data

Loan Request Get Credit Score Get Banks

Best Quote

Recipient List

Aggegator

cond1 pipe1

pipe2cond2

cond3 pipe3

["pipe1" ∈ l]

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

y

y

y

condi

(y,l) ["pipei" ∉ l]x x x

req x

x z y l

z

enrich x z y y y

req y

l

(y,l)

pipefirstdata

[isFirst q]

q

aggr.update b q

b[isComplete b]

data

[canUpdate q b]

q

f qbb

y

y

y

q

Banks

["pipe2" ∈ l]

["pipe3" ∈ l]

var x : LoanRequest;var y : ScoredLoanRequest;var z : CreditScore;var l : ListOfBanks;var q, b : Quote;

fun req x = …;fun req y = …;fun isFirst q = …;fun canUpdate q b = …;fun update b q = …;fun isComplete b = …;fun f q = …;

Simulation

Model Checking

Completion

Execution

1. Translation Details2. Why Coloured Petri

Nets?

1.2.

Page 7: Christian gierds 2013-06-20-c ai-se

Translation in Detail (1/3)Enterprise Integration

7

Loan Broker

Get Credit Score Get Banks

Credit Bureau Rule Base

Recipient List

Aggregator

Bank 2

Bank 1

Bank 3

Loan Request

Best Quote

Content Enricher

var x : Type1;var z : TypeReply;fun enrich x z = …;

pipe pipex enrich x z

chan

req x

chan

x x

z

Type1Type1 Type2

Page 8: Christian gierds 2013-06-20-c ai-se

Translation in Detail (2/3)Enterprise Integration

8

Loan Broker

Get Credit Score Get Banks

Credit Bureau Rule Base

Recipient List

Aggregator

Bank 2

Bank 1

Bank 3

Loan Request

Best Quote

Recipient List colset InTyp = Type;colset SL = list String;colset valWithList = product Type * SL;var x : Type;var l : SL;fun inList l string = …;

pipe1

pipen

addr list

pipe

xSL

x

[inList l "pipe1"]l (x,l)

(x,l)

(x,l)

(x,l)

(x,l)

x[inList l "pipen"]

[not inList l "pipe1"]

[not inList l "pipen"]

... ...

InType (x,l)

Page 9: Christian gierds 2013-06-20-c ai-se

Translation in Detail (3/3)Enterprise Integration

9

Loan Broker

Get Credit Score Get Banks

Credit Bureau Rule Base

Recipient List

Aggregator

Bank 2

Bank 1

Bank 3

Loan Request

Best Quote

Aggregator

var x : Type;var y : AggregatedType;fun isFirst x = …;fun canUpdate x y = …;fun isComplete y = …;fun update y x = …;fun f x = …;

pipefirstdata

[isFirst x]

xf x

aggr.xupdate y x

y[isComplete y]

pipeyy

[canUpdate x y]

Page 10: Christian gierds 2013-06-20-c ai-se

colset InTyp = Type;colset SL = list String;colset valWithList = product Type * SL;var x : Type;var l : SL;fun inList l string = …;

pipe1

pipe3

addr list

pipe

x

SL

x

[inList l "pipe1"]

l (x,l)

(x,l)

(x,l)

(x,l)

(x,l)

x

[inList l "pipe3"]

[not inList l "pipe1"]

[not inList l "pipe3"]

valWithList

valWithList

valWithList

... ...

InType

Connecting PatternsEnterprise Integration

10

colset OutType = …;...

pipe pipex enrich x z

chan

req x

chan

x x

z

Type1 OutType

Now unify types and change declarations!

Page 11: Christian gierds 2013-06-20-c ai-se

WHY COLOURED PETRI NETS?

Enterprise Integration

11

Page 12: Christian gierds 2013-06-20-c ai-se

Why Coloured Petri Nets? (1/2)Enterprise Integration

12

Simulation in CPN Tools

• finding flaws

• performance analysis

Model Checking

• ASK-CTL

• abstraction

Execution

• refine model

• Tsinghua Workflow

Management System

• code generation

data

Loan Request Get Credit Score Get Banks

Best Quote

Recipient List

Aggegator

cond1 pipe1

pipe2cond2

cond3 pipe3

["pipe1" ∈ l]

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

y

y

y

condi

(y,l) ["pipei" ∉ l]x x x

req x

x z y l

z

enrich x z y y y

req y

l

(y,l)

pipefirstdata

[isFirst q]

q

aggr.update b q

b[isComplete b]

data

[canUpdate q b]

q

f qbb

y

y

y

q

Banks

["pipe2" ∈ l]

["pipe3" ∈ l]

var x : LoanRequest;var y : ScoredLoanRequest;var z : CreditScore;var l : ListOfBanks;var q, b : Quote;

fun req x = …;fun req y = …;fun isFirst q = …;fun canUpdate q b = …;fun update b q = …;fun isComplete b = …;fun f q = …;

Page 13: Christian gierds 2013-06-20-c ai-se

data

Loan Request Get Credit Score Get Banks

Best Quote

Recipient List

Aggegator

cond1 pipe1

pipe2cond2

cond3 pipe3

["pipe1" ∈ l]

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

(y,l)

y

y

y

condi

(y,l) ["pipei" ∉ l]x x x

req x

x z y l

z

enrich x z y y y

req y

l

(y,l)

pipefirstdata

[isFirst q]

q

aggr.update b q

b[isComplete b]

data

[canUpdate q b]

q

f qbb

y

y

y

q

Banks

["pipe2" ∈ l]

["pipe3" ∈ l]

var x : LoanRequest;var y : ScoredLoanRequest;var z : CreditScore;var l : ListOfBanks;var q, b : Quote;

fun req x = …;fun req y = …;fun isFirst q = …;fun canUpdate q b = …;fun update b q = …;fun isComplete b = …;fun f q = …;

Why Coloured Petri Nets? (2/2)Control Flow Completion:• generate control flow dependencies

Enterprise Integration

13

Requests vs. Replies

Page 14: Christian gierds 2013-06-20-c ai-se

Take Home Points

• built on best practice modeling patterns• complementing EIP with formal model• bridging the gap: enabling analysis before

actual implementation• project: Modeling tool with automatic

translation

Enterprise Integration

14

Loan BrokerCustomer Bank 2

Bank 1

Bank 3Credit Bureau

Loan Broker

Get Credit Score Get Banks

Credit Bureau Rule Base

Recipient List

Aggregator

Bank 2

Bank 1

Bank 3

Loan Request

Best Quote

Simulation

Model Checking

Completion

Execution

Thank you for your attention!