1.31k likes | 1.32k Vues
Santa Cruz (CA) USA, 18 January 2005. Calculi for Committed Choices and Compensations Roberto Bruni - Dipartimento di Informatica, Università di Pisa. joint work with Gianluigi Ferrari Hern á n Melgratti Ugo Montanari Daniele Strollo Emilio Tuosto Dip. Informatica, Univ. Pisa.
E N D
Santa Cruz (CA) USA, 18 January 2005 Calculi for Committed Choices and CompensationsRoberto Bruni - Dipartimento di Informatica, Università di Pisa joint work with Gianluigi Ferrari Hernán Melgratti Ugo Montanari Daniele Strollo Emilio Tuosto Dip. Informatica, Univ. Pisa
Motivations • Design of business processes • rigorous mathematical foundations • clean semantics • “expressiveness” • well-disciplined service composition • modular implementation • Web Service Composition • defining complex services as aggregations of simpler services Calculi for Committed Choices and Compensations
Motivations • In long lasting negotiations partial agreements can be reached and locally committed by parties • To be compensated in case of failure • To be published / confirmed on success • Formal models are needed • To discover specification bugs • To reason rigorously • To run simulations • To ease verification Calculi for Committed Choices and Compensations
Compensations • To Compensate (Merriam-Webster OnLine) • to neutralize the effect of • to supply an equivalent to • to provide with means of counteracting variation • to offset an error, defect, or undesired effect • The most important fact: • Compensations have a cost Calculi for Committed Choices and Compensations
Compensations: Examples • Late cancelling of hotel reservations can involve payment of fees • Failures on credit checks can cause the abort of parallel activities (which can be partially completed) e.g. • to unpackage the goods to be sent • to cancel the courier booking • Statements of politicians typically require an unbounded number of nested compensations Calculi for Committed Choices and Compensations
Approaches • Flow Composition or Hierarchical Patterns • Similar to workflow systems: a process describes the flow of both control and data among WS • Interaction based Composition, Conversational Patterns or Global Model • Services describe the ways they can be engaged in a larger process Calculi for Committed Choices and Compensations
Flow Composition A2 A3 A1 A4 A5 Calculi for Committed Choices and Compensations
Transactional Flows A2 A3 A1 A4 A5 Calculi for Committed Choices and Compensations
Compensation A2 A3 B2 B3 A1 A4 B1 B4 A5 B5 Calculi for Committed Choices and Compensations
A2 A3 B2 B3 A1 A4 B1 B4 A5 B5 Compensation Flow Calculi for Committed Choices and Compensations
Nested Flow Diagrams A2 A3 B2 B3 A1 A4 B1 B4 P Calculi for Committed Choices and Compensations
Interaction and Agreements • In commercial applications, separately designed and implemented components must interact • avoiding ad-hoc proprietary solutions • offering alternatives to centralized transaction managers • hiding the coordination layer (separation of concerns) Calculi for Committed Choices and Compensations
Interacting Transactions {} P2 P1 {} P3 {} Calculi for Committed Choices and Compensations
Interacting Transactions {} P2 P1 {} P3 {} Calculi for Committed Choices and Compensations
Interacting Transactions {P3} P2 P1 {P2} P3 {} Calculi for Committed Choices and Compensations
Interacting Transactions {P3} P2 P1 {P2} P3 {} Calculi for Committed Choices and Compensations
Interacting Transactions {P1,P3} P2 P1 {P2} P3 {P2} Calculi for Committed Choices and Compensations
Outline of the talk • Part I • Transactional Flows with Compensations • Part II • A Process Calculus for Distributed Transactions • Part III • Prototype Implementations Calculi for Committed Choices and Compensations
Outline of the talk • Part I • Transactional Flows with Compensations • Part II • A Process Calculus for Distributed Transactions • Part III • Prototype Implementations Calculi for Committed Choices and Compensations
Part I - Flows • Sequential Sagas • Graphical representation • Syntax • Big Step Semantics • Adequacy results • Parallel Sagas • Nested Sagas • Additional features Calculi for Committed Choices and Compensations
Flow Diagrams and PDLs • Many PDL proposals to describe business processes unambiguously • XML-based • WSFL, XLANG, BPEL4WS, … • Extensions of known calculi • committed Join (cJOIN), t-calculus, web-calculus • Flow-based • Structured Activity Compensation (StAC) • now evolving to compensating CSP • core flow language (FL) for sagas [BMM:POPL2005] Calculi for Committed Choices and Compensations
Sequential Sagas: Graphically Accept Order Update Credit Prepare Order Refuse Order Refund Money Update Stock Calculi for Committed Choices and Compensations
Sequential Sagas: Syntax Accept Order Update Credit Prepare Order Refuse Order Refund Money Update Stock (Step) X ::= 0 | A | A%B (Process) P ::= X | P;P (Saga) S ::= { P } Calculi for Committed Choices and Compensations
Sequential Sagas: Syntax Accept Order Update Credit Prepare Order Refuse Order Refund Money Update Stock S = { AO%RO; UC%RM ; PO%US} (Step) X ::= 0 | A | A%B (Process) P ::= X | P;P (Saga) S ::= { P } Calculi for Committed Choices and Compensations
Sequential Sagas: Semantics • An activity A either • commits (A ) • aborts (A ) • = {A1 ,…, An } Calculi for Committed Choices and Compensations
Sequential Sagas: Semantics • A saga S = { P }under either • commits ( ) • aborts ( ) • fails ( ) • is the observable flow S S S * Calculi for Committed Choices and Compensations
Sequential Sagas: Semantics • A processPunder either • commits ( ) • aborts ( ) • fails ( ) • aborts = successfully compensated • ß, ß’ are the installed compensations <P,ß> < ,ß’> <P,ß> < , 0> <P,ß> < , 0> * Calculi for Committed Choices and Compensations
Sequential Sagas: Semantics <P,0> < , ß> (saga) {P} Calculi for Committed Choices and Compensations
Sequential Sagas: Semantics <P,0> < , ß> (saga) {P} 0 (zero) <0,ß> < , ß> Calculi for Committed Choices and Compensations
Sequential Sagas: Semantics <P,0> < , ß> (saga) {P} 0 (zero) <0,ß> < , ß> A (s-act) A , <A%B, ß> < , B;ß> Calculi for Committed Choices and Compensations
Sequential Sagas: Semantics <P,0> < , ß> (saga) {P} 0 (zero) <0,ß> < , ß> A (s-act) A , <A%B, ß> < , B;ß> <ß,0> < , 0> (s-cmp) A , <A%B,ß> < , 0> <ß,0> < , 0> (f-cmp) A , <A%B,ß> < , 0> * Calculi for Committed Choices and Compensations
Sequential Sagas: Semantics ’ <P,ß> < ,ß’’> <Q,ß’’> < ,ß’> (s-step) ;’ <P;Q, ß> < ,ß’> <P,ß> < , 0> (a-step’) <P;Q,ß> < ,0> <P,ß> < , 0> * (a-step’’) <P;Q,ß> < ,0> * Calculi for Committed Choices and Compensations
Sequential Sagas: Adequacy and = A1;…;An S Ak A1 Aj An Calculi for Committed Choices and Compensations
Sequential Sagas: Adequacy and = A1;…;An S Ak A1 Aj An and = A1;…;Ak-1;Bk-1;…;B1 S Ak A1 Aj An B1 Bj Calculi for Committed Choices and Compensations
Sequential Sagas: Adequacy and = A1;…;An S Ak A1 Aj An and = A1;…;Ak-1;Bk-1;…;B1 S Ak A1 Aj An B1 Bj and = A1;…;Ak-1;Bk-1;…;Bj+1 S * Ak A1 Aj An B1 Bj Calculi for Committed Choices and Compensations
Parallel Sagas: Syntax Update Credit Refund Money Accept Order Refuse Order Prepare Order Update Stock Calculi for Committed Choices and Compensations
Parallel Sagas: Syntax Update Credit Refund Money Accept Order Refuse Order Prepare Order Update Stock (Step) X ::= 0 | A | A%B (Process) P ::= X | P;P | P|P (Saga) S ::= { P } Calculi for Committed Choices and Compensations
Parallel Sagas: Syntax Update Credit Refund Money Accept Order Refuse Order Prepare Order Update Stock S = { AO%RO; UC%RM | PO%US } (Step) X ::= 0 | A | A%B (Process) P ::= X | P;P | P|P (Saga) S ::= { P } Calculi for Committed Choices and Compensations
Parallel Sagas: Naïvely B1 Bj Bn B’1 B’j A1 A2 A’1 C1 Ck Cm C’1 C’k C’m A1;(B1;…;Bj-1;B’j-1;…;B’1 | C1;…Cm;C’m;…;C’1);A’1 Calculi for Committed Choices and Compensations
Parallel Sagas: Revised B1 Bj Bn B’1 B’j A1 A2 A’1 C1 Ck Cm C’1 C’k C’m A1;(B1;…;Bj-1;B’j-1;…;B’1 | 0);A’1 A1;(B1;…;Bj-1;B’j-1;…;B’1 | C1;C’1);A’1 … A1;(B1;…;Bj-1;B’j-1;…;B’1 | C1;…Cm;C’m;…;C’1);A’1 Calculi for Committed Choices and Compensations
* Parallel Sagas: Semantics • A process P under either • commits ( ) • aborts ( ) • fails ( ) • is forced to abort ( ) • is forced to fail ( ) • is the observableconcurrentflow <P,ß> < ,ß’> <P,ß> < , 0> <P,ß> < , 0> * <P,ß> < , 0> <P,ß> < , 0> Calculi for Committed Choices and Compensations
* Parallel Sagas: Semantics <P,0> <, ß> { , , } (saga) * {P} <ß, 0> < , 0> (forced-abt’) <P,ß> < ,0> <ß, 0> < , 0> (forced-abt’’) <P,ß> < ,0> Calculi for Committed Choices and Compensations
Parallel Sagas: Semantics ’ <P,0> < ,ß’> <Q,0> < ,ß’’> (s-par) |’ <P|Q, ß> < ,ß’|ß’’; ß> Calculi for Committed Choices and Compensations
* * * * Parallel Sagas: Semantics (c-par’) 1, 2 { , } ’ <P,0> <1,0> <Q,0> <2,0> <ß,0> < ,0> |’; <P|Q, ß> < 1 2 , 0> * * * * * * * Calculi for Committed Choices and Compensations
* * * * * Parallel Sagas: Semantics (c-par’’) 1, 2 { , } ’ <P,0> <1,0> <Q,0> <2,0> <ß,0> < ,0> |’; <P|Q, ß> < 1 2 , 0> * * * * * * * Calculi for Committed Choices and Compensations
* * * * * * Parallel Sagas: Semantics (f-par) 1 { , } ’ * <P,0> <1,0> <Q,0> <2 ,0> 2 { , , , } * |’ <P|Q, ß> < 1 2, 0> * * * * * * * Calculi for Committed Choices and Compensations
Parallel Sagas: Adequacy Completion Calculi for Committed Choices and Compensations
Parallel Sagas: Adequacy Successful Compensation Calculi for Committed Choices and Compensations
Parallel Sagas: Adequacy Failed Compensation Calculi for Committed Choices and Compensations
Nested Sagas: Graphically Update Credit Refund Money Accept Order Refuse Order Prepare Order Update Stock Add Points Subtract Points Calculi for Committed Choices and Compensations