Ivan LaneseDepartment of Computer Science University of Bologna INRIA research team FOCUS Choreography-driven design Joint work with: Mario Bravetti, Gianluigi.

Slides:



Advertisements
Similar presentations
Synthesis of Protocol Converter Using Timed Petri-Nets Anh Dang Balaji Krishnamoorthy Manoj Iyer Presented by:
Advertisements

Web Services Choreography Description Language Overview 24th November2004 Steve Ross-Talbot Chief Scientist, Enigmatec Corporation Ltd Chair W3C Web Services.
Design by Contract.
1 Ivan Lanese Computer Science Department University of Bologna Italy Managing faults and compensations in SOCK Joint work with Claudio Guidi, Fabrizio.
C. Compositional Design and Verification of Component-Based Information Systems Jan Martijn van der Werf.
1 University of Pennsylvania Grigoris Karvounarakis February 2004 Conversation Specification: A New Approach to Design and Analysis of E- Service Composition.
© 2012 Metamaxim Ltd Modelling Choreography Ashley McNeile 1 st February 2012.
Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.
1 Reversibility for Recoverability Ivan Lanese Computer Science Department FOCUS research group University of Bologna/INRIA Bologna, Italy.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Fault in the Future Joint work with Gianluigi Zavattaro and Einar Broch Johnsen.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture # 11.
1 The SOCK SAGA Ivan Lanese Computer Science Department University of Bologna Italy Joint work with Gianluigi Zavattaro.
Architecture-driven Modeling and Analysis By David Garlan and Bradley Schmerl Presented by Charita Feldman.
1 Synchronization strategies for global computing models Ivan Lanese Computer Science Department University of Bologna.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
1 Ivan Lanese Computer Science Department University of Bologna Roberto Bruni Computer Science Department University of Pisa A mobile calculus with parametric.
Business Process Orchestration
1 SOCK and JOLIE from the formal basis to a service oriented programming language Ivan Lanese Computer Science Department University of Bologna Italy Joint.
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
1 Ivan Lanese Computer Science Department University of Bologna Italy Behavioural Theory for SSCC Joint work with Luis Cruz-Filipe, Francisco Martins,
1 Ivan Lanese Computer Science Department University of Bologna Italy Evolvable systems: some ideas for modelling With input from Davide Sangiorgi, Fabrizio.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
1 Static vs dynamic SAGAs Ivan Lanese Computer Science Department University of Bologna/INRIA Italy.
1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and.
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
Canonical Prefixes of Petri Net Unfoldings Walter Vogler Universität Augsburg in cooperation with V. Khomenko, M. Koutny (CAV 2002, Acta Informatica 2003)
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Fault in the Future Joint work with Gianluigi Zavattaro and Einar Broch Johnsen.
1 Ivan Lanese Computer Science Department University of Bologna Italy On the expressive power of primitives for compensation handling Joint work with Catia.
1 Ivan Lanese Computer Science Department University of Bologna Italy Behavioural Theory at Work: Program Transformations in a Service-centred Calculus.
1 Ivan Lanese Computer Science Department University of Bologna Italy Streaming Services in SSCC Joint work with Francisco Martins, Vasco Vasconcelos and.
1 Ivan Lanese Computer Science Department University of Bologna Italy Towards a Unifying Theory for Web Services Composition Manuel Mazzara Faculty of.
Model-based Methods for Web Service Verification.
Dynamic Choreographies Safe Runtime Updates of Distributed Applications Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Joint.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
SDS Foil no 1 Process Algebra Process Algebra – calculating with behaviours.
Towards Global and Local Types for Adaptation Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Joint work with Mario Bravetti,
1 The CeNTIE project is supported by the Australian Government through the Advanced Networks Program of the Department of Communications, Information Technology.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Amending Choreographies Joint work with Fabrizio Montesi and Gianluigi Zavattaro.
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
The GOOD the BAD the UGLY WS-CDL: the GOOD the BAD the UGLY.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 7: BPEL Some notes selected from.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Mario Bravetti Department of Computer Science University of Bologna INRIA research team FOCUS Choreography Projection and.
Natallia Kokash (Accepted for PACO’2011) ACG, 31/05/ Input-output conformance testing for channel-based connectors 1.
1 Capturing Requirements As Use Cases To be discussed –Artifacts created in the requirements workflow –Workers participating in the requirements workflow.
1 Capturing Requirements As Use Cases To be discussed –Artifacts created in the requirements workflow –Workers participating in the requirements workflow.
Process-oriented System Analysis Process Mining. BPM Lifecycle.
“Dynamic fault handling mechanisms for service-oriented applications” Fabrizio Montesi, Claudio Guidi, Ivan Lanese and Gianluigi Zavattaro Department of.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Decidability Results for Dynamic Installation of Compensation Handlers Joint.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
Systems Analysis and Design in a Changing World, Fourth Edition
Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)
Dr. Rebhi S. Baraka Advanced Topics in Information Technology (SICT 4310) Department of Computer Science Faculty of Information Technology.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Introduction to distributed systems description relation to practice variables and communication primitives instructions states, actions and programs synchrony.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Adaptive Choreographies Joint work with Mila Dalla Preda, Jacopo Mauro and Maurizio.
1 Seminar on SOA Seminar on Service Oriented Architecture BPEL Some notes selected from “Business Process Execution Language for Web Services” by Matjaz.
Compositional Choreographies By Fabrizio Montesi and Nobuko Yoshida
composition of workflows
Deadlock Freedom by Construction
Automatic Verification
Choreography, Orchestration, and Contracts Languages and Techniques for Service Composition Gianluigi Zavattaro
Presentation transcript:

Ivan LaneseDepartment of Computer Science University of Bologna INRIA research team FOCUS Choreography-driven design Joint work with: Mario Bravetti, Gianluigi Zavattaro

Plan of the  From Choreography to Contracts  Contract-based Service Discovery  Conclusion Plan of the Talk

Different models for interacting systems  Choreography (e.g. WS-CDL): Top abstract view of the system, composed by communications involving two of its participants  Orchestration (e.g. WS-BPEL) Set of contracts describing the components of the system, composed by sendings & receivings of messages

WS-CDL  Global view of service interactions Buyer Seller Bank

WS-CDL  Global view of service interactions Buyer Seller Request Bank

WS-CDL  Global view of service interactions Buyer Seller PayDescr Request Offer Bank

WS-CDL  Global view of service interactions Buyer Seller PayDescr Request Offer Bank Payment

WS-CDL  Global view of service interactions Buyer Seller PayDescr Request Offer Bank Payment Confirm Receipt

WS-CDL Request Buyer  Seller ; (Offer Seller  Buyer | PayDescr Seller  Bank ) ; Payment Buyer  Bank ; (Confirm Bank  Seller | Receipt Bank  Buyer ) Explicit representation of concurrency

Projection of the Choreography on the Single Participants Buyer: Seller: Receive(Request); | Receive(Confirm) Bank: Receive(PayDescr);Receive(Payment); |

Well Formed WS-CDL Choreographies  Can we always project (in a simple way) a WS-CDL choreography by preserving its behavior?  Which kind of behavior is preserved?

A Formal Model for WS-CDL  A global choreography language: H ::=a r  s | 1 | 0 | H;H | H+H | H|H

A Formal Model for WS-CDL  A global choreography language: H ::=a r  s | 1 | 0 | H;H | H+H | H|H r invokes the operation a of s Successful termination Unsuccessful termination

A Formal Model for WS-CDL  A global choreography language: H ::=a r  s | 1 | 0 | H;H | H+H | H|H Choice Sequence Parallel

A Formal Model for orchestrations  A language for orchestrations: P ::=a | a r | 1 | 0 | P;P | P+P | P|P S ::= [P] r | S|S

A Formal Model for orchestrations  A language for orchestrations: P ::=a | a r | 1 | 0 | P;P | P+P | P|P S ::= [P] r | S|S receive on a Successful termination Unsuccessful termination invoke a at r

A Formal Model for orchestrations Choice Sequence Parallel  A language for orchestrations: P ::=a | a r | 1 | 0 | P;P | P+P | P|P S ::= [P] r | S|S

A Formal Model for orchestrations  A language for orchestrations: P ::=a | a r | 1 | 0 | P;P | P+P | P|P S ::= [P] r | S|S Behaviour of participant r Parallel composition of participants

The “canonical” projection  Projection [[ H ]] t of choreography H to participant t a s if t=r [[ a r  s ]] t =aif t=s 1otherwise [[H;H’]] t =[[H]] t ; [[H’]] t [[H|H’]] t =[[H]] t | [[H’]] t [[H+H’]] t =[[H]] t + [[H’]] t  Essentially an homomorphism

Example  Consider the global choreography: a r  s ; b t  u  Projection: [ a s ;1] r | [ a;1 ] s | [ 1;b u ] t | [ 1;b ] u  Are the two models equivalent? NO But, if r=t…. YES (synchronous) [ a s ; b u ] r | [ a;1 ] s | [ 1;b ] u

Asynchronous communication  Reconsider the example assuming asynchronous communication [ a s ; b u ] r | [ 1;a ] s | [ 1;b ] u  Communication on a starts before communication on b but could finish after  What we should observe? Send, receive, both, …?

A lattice of possible observation criteria SenderReceiver Sender-receiver Synchronous Disjoint

A lattice of possible observation criteria SenderReceiver Sender-receiver Synchronous Disjoint Assuming synchronous communication: observe either send or receive

A lattice of possible observation criteria SenderReceiver Sender-receiver Synchronous Disjoint Assuming asynchronous communication: observe send

A lattice of possible observation criteria SenderReceiver Sender-receiver Synchronous Disjoint Assuming asynchronous communication: observe receive

A lattice of possible observation criteria SenderReceiver Sender-receiver Synchronous Disjoint Assuming asynchronous communication: observe send and observe receive

A lattice of possible observation criteria SenderReceiver Sender-receiver Synchronous Disjoint Assuming asynchronous communication: observe send and receive together

What about the previous example?  Reconsider the example a r  s ; b r  u [ a s ; b u ] r | [ 1;a ] s | [ 1;b ] u  OK: for synchronous and sender  NO: for receiver, sender-receiver, disjoint

Main result  For each observation criterion: Sufficient syntactic conditions (connectedness, unique point of choice, and causality safety) that guarantee that a choreography is equivalent to its projection

Unique point of choice  In a choice H+H’ The sender of the initial transitions in H and in H’ is always the same The roles in H and in H’ are the same  Example: if we drop the second condition (a r  s + b r  t ); c s  t [ ( a s +b t );1] r | [ (a+1);c t ] s | [ (1+b);c ] t

Which equivalence between choreography and orchestration?  Synchronous equivalence: global transitions are matched by synchronous local transitions  Sender equivalence: global transitions are matched by local sends, local receives are abstracted away weak w.r.t. local receive transitions  Receiver equivalence: global transitions are matched by local receives, local sends are abstracted away weak w.r.t. local send transitions  Sender-Receiver equivalence: both conditions above  Disjoint equivalence: global transitions are matched by a pair of a local send and a local receive

Example: Receiver equivalence  Global choreography: a r  s ; b t  s  Local choreography: [ 1;a s ] r | [ a;b ] s | [ 1;b s ] t  The two systems are receiver equivalent

Amending choreographies  What can we do if a choreography does not satisfy the conditions? We can automatically transform it into one that satisfies the conditions for disjoint equivalence Preserving the “weak” traces  We add actions which are used only for synchronization and are not observed

Example: Amending choreographies  Original choreography: ( a r  s | c r  u ) ; b t  s  Amended choreography: ( a r  s ; h* s  z |c r  u ; i* u  z ) ;j* z  t ; b t  s  The two systems are now weak disjoint equivalent  Similar patterns for all the criteria

Which equivalence to choose?  Synchronous equivalence: if I have a synchronous system (easy )  Sender equivalence: ensures that data are available when needed  Receiver equivalence: ensures that invariants in the choreography hold in the projected system  Sender-Receiver equivalence: both the properties above  Disjoint equivalence: robust also in case of message loss

Example  Consider the global choreography: withdraw cust  bank ; pay cust  shop  Projection: [ w bank ;p shop ] cust | [ 1;w ] bank | [ 1;p ] shop  In the choregraphy money is never created  In the system I can pay before the bank has updated my account amount

Example  In a receiver connected choreography this will not happen withdraw cust  bank ; notify bank  shop ; pay cust  shop  Also in the projection the bank has updated the account before money can be spent

Plan of the  From Choreography to Contracts  Contract-based service discovery  Conclusion Plan of the Talk

Contracts  Contract: service “behavioural interface” correct sequence of invoke and receive just finite-state labeled transition system with successful termination Contract: abstract service description Service public registry

Contract Compliance  Verification of correctness of service composition based on their contracts: successful interaction i.e. no deadlock / termination reached Contract: abstract service description Service … Contract: abstract service description Service … public registry Reciprocal invocations

Service Compliance: Formally  Services are compliant if the following holds for their composition S : S --->* S’ implies that there exist S’’ and S’’’ s.t. S’ --->* S’’ ---> S’’’ i.e. every computation can be extended to reach successful completion of all services termination under fairness assumption τ √ τ

Example: compliant services  The following pairs of services are compliant: C 1 = a+b+cC 2 = a + b C 1 = a;bC 2 = a | b C 1 = (a; b )* C 2 = a;( b;a )*;b

… Choreography Compliance-Preserving Contract Refinement ! Contract public registry Contract public registry Service … Reciprocal invocations Contract Part. 1 Contract Part. n … refines compliance preserved by refinement compliant by construction projection

… Choreography Contract Refinement Relation Contract public registry Contract public registry Service … Reciprocal invocations Contract Part. 1 Contract Part. n … refines compliance preserved by refinement compliant by construction

Formally: Subcontract Preorder C sub-contracts of C subcontract preorder  Preorder ≤ between contracts C : C’ ≤ C means C’ is a subcontract of C

Definition of Preorder Induced from Independent Refinement C 1 C 2 C n Given a set of compliant contracts is a set of compliant contracts subcontract preorder sub-contracts of C 2 … sub-contracts of C 1 sub-contracts of C n C’ 1 C’ 2 C’ n … …

No maximal subcontract preorder … in general  Consider the system: [ a ] | [ a ] we could have one preorder ≤ 1 for which a + c.0 ≤ 1 a and one preorder ≤ 2 for which a + c.0 ≤ 2 a but no subcontract preorder could have a + c.0 ≤ a  Consequence: no independent refinement!

Maximal pre-order  It exists under some assumptions: Limiting the considered services (output persistence) Strengthening the notion of compliance (strong compliance) Moving to asynchronous communication (e.g. via message queues)

Output persistence  Output persistence means that given a process state P: If P has an output action on a and P-->P’ with  different from output on a, then also P’ has an output on a  This holds, for instance, in WS-BPEL (without faults) Pick operator is input guarded  Difficult to force if mixed choice is used 

Example  Given the choreography: Request Alice  Bob ; (Accept Bob  Alice + Reject Bob  Alice ) The following services can be retrieved: [τ;Request Bob ;(Accept+Reject)] Alice | [Request;(τ;Accept Alice +τ;Reject Alice )] Bob

Example  Given the choreography: Request Alice  Bob ; (Accept Bob  Alice + Reject Bob  Alice ) The following services can be retrieved: [τ;Request Bob ;(Accept+Reject)] Alice | [Request;(τ;Accept Alice +τ;Reject Alice )] Bob [τ;Request Bob ;(Accept+Reject+Retry)] Alice | [Request;(τ;Accept Alice +τ;Reject Alice )] Bob

Example  Given the choreography: Request Alice  Bob ; (Accept Bob  Alice + Reject Bob  Alice ) The following services can be retrieved: [τ;Request Bob ;(Accept+Reject)] Alice | [Request;(τ;Accept Alice +τ;Reject Alice )] Bob [τ;Request Bob ;(Accept+Reject+Retry)] Alice | [Request;(τ;Accept Alice +τ;Reject Alice )] Bob [τ;Request Bob ;(Accept+Reject+Retry)] Alice | [Request;τ;Accept Alice ] Bob

“Standard” Contract Compliance  Example: S 1 : invoke(a);invoke(b) S 2 : receive(a);invoke(c) S 3 : receive(c);receive(b) S1S1 S2S2 S3S3

“Standard” Contract Compliance  Example: S 1 : invoke(a);invoke(b) S 2 : receive(a);invoke(c) S 3 : receive(c);receive(b) S1S1 S2S2 S3S3

“Standard” Contract Compliance  Example: S 1 : invoke(a);invoke(b) S 2 : receive(a);invoke(c) S 3 : receive(c);receive(b) S1S1 S2S2 S3S3

“Standard” Contract Compliance  Example: S 1 : invoke(a);invoke(b) S 2 : receive(a);invoke(c) S 3 : receive(c);receive(b) S1S1 S2S2 S3S3

 Let us give a more careful look: S 1 : invoke(a);invoke(b) S 2 : receive(a);invoke(c) S 3 : receive(c);receive(b) S1S1 S2S2 S3S3 Alternatives to Standard Compliance: Strong Compliance

 Let us give a more careful look: S 1 : invoke(a);invoke(b) S 2 : receive(a);invoke(c) S 3 : receive(c);receive(b) S1S1 S2S2 S3S3

 Let us give a more careful look: S 1 : invoke(a);invoke(b) S 2 : receive(a);invoke(c) S 3 : receive(c);receive(b) S1S1 S2S2 S3S3  Strong compliance requires that the receptors should be always ready  These services are not strongly compliant !! Alternatives to Standard Compliance: Strong Compliance

Example: strong compliant services  The following pairs of services are strong compliant: C 1 = a+b+cC 2 = a + b C 1 = a;bC 2 = a | b C 1 = (a; b )* C 2 = a;( b;a )*;b

Example: strong compliant services  The following pairs of services are strong compliant: C 1 = a+b+cC 2 = a + b C 1 = a;bC 2 = a | b C 1 = (a; b )* C 2 = a;( b;a )*;b

“Strong” refinement  It allows also refinement on names already in the interface: Receive(a);(Receive(b)+Receive(a)) ≤ Receive(a);Receive(b)

Summary of Results  “Normal” compliance: Unconstrained contracts: maximal relation does not exist Contracts satisfying output persistence: maximal relation exists if output alphabet of contracts is known Contracts satisfying output persistence where outputs are directed to a location: maximal relation exists  Strong compliance: Unconstrained contracts (where output are directed to a location): maximal relation exists  Queue-based compliance: Unconstrained contracts (where output are directed to a location): maximal relation exists

Summary of Results  Direct conformance w.r.t. the whole choreography: maximal relation does not exist (all kinds of compl.)  Sound characterizations of the relations obtained (apart from the queue based) by resorting to an encoding into (a fair version of) must testing [RV05] With respect to testing: both system and test must succeed  As a consequence: Algorithm that guarantees compliance Classification of the relations w.r.t. existing pre-orders: coarser than (fair) must testing (e.g., they allow external non-determinism on inputs to be added in refinements)

Plan of the  From Choreography to Contracts  Contract-based service discovery  Conclusion Plan of the Talk

Future work  Choreographies with dynamic participant creation  Contracts with operators for process interruption and compensation The contract language becomes partially undecidable

Related work  Carbone, Honda, Yoshida Global and End-point calculus similar to our choreography and orchestration Only some of our observation criteria are considered Stronger conditions for projection

Related work  Fu, Bultan, Su Service systems with message queues similar to ours Observe the send event as in our sender observation criterion No refinement

Related work  Padovani et al. Contracts described with an ad-hoc transition system (reminiscent of acceptance tree) The absence of maximal subcontract relation solved either with explicit interfaces or filters (cut the additional actions of the refinements)

Related work  van der Aalst et al. Contracts described with open workflow nets (similar to petri nets) Same notion of compliance Same definition of subcontract as maximal refinement that preserves compliance Characterization of the refinement for processes without “loops” (make the system infinite due to message queues)

References  M. Bravetti and G. Zavattaro. Contract based Multi-party Service Composition. In FSEN’07. (full version in Fundamenta Informaticae)  M. Bravetti and G. Zavattaro. Towards a Unifying Theory for Choreography Conformance and Contract Compliance. In SC’07.  M. Bravetti and G. Zavattaro. A Theory for Strong Service Compliance. In Coordination’07. (full version in MSCS)  M. Bravetti and G. Zavattaro. Contract Compliance and Choreography Conformance in the presence of Message Queues.In WS-FM’08  M. Bravetti and G. Zavattaro. On the Expressive Power of Process Interruption and Compensation. In WS-FM’08  I. Lanese, C. Guidi, F. Montesi, and G. Zavattaro. Bridging the Gap Between Interaction- and Process-oriented Choreographies. In SEFM’08.  M. Bravetti, I. Lanese, G. Zavattaro. Contract-Driven Implementation of Choreographies.In TGC'08  M. Bravetti, G. Zavattaro. Contract-Based Discovery and Composition of Web Services. In Formal Methods for Web Services, Advanced Lectures, LNCS 5569  M. Boreale, M. Bravetti. Advanced Mechanisms for Service Composition, Query and Discovery in Rigorous Software Eng. for Service-Oriented Systems, LNCS, to appear