WS Choreography v 0 1 Overview This is

  • Slides: 30
Download presentation
WS Choreography v. 0 -1 Overview This is work-in-progress David Burdett, Commerce One 18

WS Choreography v. 0 -1 Overview This is work-in-progress David Burdett, Commerce One 18 June 2003

Topics § § 2 Feature Overview XML Structures What’s missing Issues Commerce One Copyright

Topics § § 2 Feature Overview XML Structures What’s missing Issues Commerce One Copyright © 2003

Feature Overview

Feature Overview

Features § Reusability § A choreography definition is reusable in different contexts with different

Features § Reusability § A choreography definition is reusable in different contexts with different software and different message formats § State Driven § Processes or organizations that take part in choreographies maintain their state in the choreography § Cooperative Organizations § Describes how independent organizations or processes cooperate § Verifiable § Choreography definition can be used to verify that a Choreography is being followed correctly (How not yet defined) § Multi-Party § The specification allows Choreography Definitions with any number of organizations or processes involved § Modular § An "import" facility allows separately define components to be imported 4 Commerce One Copyright © 2003

Reusability § Roles § Describes the type of a process/organization behavior e. g. a

Reusability § Roles § Describes the type of a process/organization behavior e. g. a Buyer or a Seller § States § Identifies the point within a choreography a Role has reached e. g. a Buyer State could be Order. Sent after sending an Order § Interactions § Communicating information from one Role to another for a reason. e. g sending an Order to request a purchase of goods § Message Families § The set of messages that serve the same or similar purpose. e. g a Rosetta. Net Order, a UBL Order, an EDI Order, are all the same § Processes § Occurs as a result of some event such as a change of State 5 Commerce One Copyright © 2003

Why Reusability is important Big Co ($$$$$) 1. Work my way or you don’t

Why Reusability is important Big Co ($$$$$) 1. Work my way or you don’t get my business! 5. Big Co doesn’t realize the benefits of automation as they can’t extend all the way down the supply chain 2. OK Medium Co ($$$) 3. Work Big Co’s way or we can’t do business! 4. STOP!!!! I can’t afford to implement all these ways. I’ll just continue with fax! Small Co ($) 3 a. Work Bigger Co’s way or we can’t do business! Medium Co 2 3 b. Work even Bigger Co’s way or we can’t do business! Medium Co 3 3 c. Work Mega Co’s way or we can’t do business! Medium Co 4 Developing reusable ways of doing business* that are based on common standards are a pre-requisite to bringing smaller businesses into widespread e. Commerce 6 Commerce One Copyright © 2003 *Choreography definitions are just one of the essential parts!

State Driven Buyer New Order Created Seller Order Sent Send Order Received Check Order

State Driven Buyer New Order Created Seller Order Sent Send Order Received Check Order Checked OK Order Error Message Checked Process Order Error Received Legend Interaction 7 State Commerce One Copyright © 2003 Process Send Order Error Sent Order Checked Rejected Order Checked Error

Interactions, Reliable Messaging and Signals The Choreography definition defines just the messages that cause

Interactions, Reliable Messaging and Signals The Choreography definition defines just the messages that cause the state to change … Buyer Seller Interaction Order Sent Reliable Messaging Signals Send Order Reliable Messaging Ack. Message Checked OK Message Processing Started Message Processing Complete … the other messages are implementation dependent 8 Commerce One Copyright © 2003 Order Received Check Order

Cooperative Organizations Private Process … but they both have to agree how they will

Cooperative Organizations Private Process … but they both have to agree how they will cooperate … Private Process Buyer Seller xxx New Order Created Order Sent Send Order Check Order Received Order Checked OK xxx Order Checked Rejected xxx xxx Order Error Message Checked Process Order Error Received The Buyer can’t control what the Seller does and vice versa … 9 Commerce One Copyright © 2003 Send Order Error Sent Order Checked Error … which means they must have a shared understanding of what each will do!

Checking Choreography Progress Buyer Choreography Definition Shared Common Choreography Definition Seller Choreography Definition State

Checking Choreography Progress Buyer Choreography Definition Shared Common Choreography Definition Seller Choreography Definition State Errors ERP Record State Order Sent Send Order Received ERP State DB Check State Errors 10 Check State Commerce One Copyright © 2003 Order Error Received Send Order Error Sent Record State

Other Features § Multi-Party Choreographies § Any number of roles can take part §

Other Features § Multi-Party Choreographies § Any number of roles can take part § One definition for all roles – makes sharing easier § Importing Definitions § Allows reusability of individual definitions, e. g. messages, roles, etc § Extending Choreography Definitions § Allows one Choreography to extend another … perhaps should be composition instead! § Choreography Dependencies § Once choreography can only execute after another, e. g. You can only query the state of a choreography if there is another choreography instance to query § Semantic Definitions § Two ways of defining semantics: in the XML, or at a URL § Multi-lingual 11 Commerce One Copyright © 2003

XML Structures Note all attributes are required unless stated as optional

XML Structures Note all attributes are required unless stated as optional

Choreography Definitions in multiple languages Import definitions from other files (works like WSDL) Define

Choreography Definitions in multiple languages Import definitions from other files (works like WSDL) Define the roles involved Define the Message Families Define the Interactions The same definitions can be reused in multiple choreographies Define or more Choreography Definitions 13 Commerce One Copyright © 2003

Choreography XML Default language for content of Description elements <Choreography default. Language="us-en" xmlns=". .

Choreography XML Default language for content of Description elements <Choreography default. Language="us-en" xmlns=". . . " xmlns: xsi="http: //www. w 3. org/2001/XMLSchema-instance">. . . </Choreography> 14 Commerce One Copyright © 2003

Description XML Optional. If present, overrides default language for content Optional. If present is

Description XML Optional. If present, overrides default language for content Optional. If present is URL of more detailed readable specification <Description language="en-uk" ref="http: //www. example. com/Chor. Specs/en-uk/Order. Management. htm"> This section contains a set of choreographies for Order Management </Description> Semantic definitions Description elements can always occur zero or more times. Each occurrence must be for a different language 15 Commerce One Copyright © 2003

Import XML <Import namespace="http: //example. com/chor/Order. Management/Roles" location="http: //example. com/chor/Order. Management/Roles"/> Import works in

Import XML <Import namespace="http: //example. com/chor/Order. Management/Roles" location="http: //example. com/chor/Order. Management/Roles"/> Import works in the same way as a WSDL Import 16 Commerce One Copyright © 2003

Role & State A Role may have one or more states 17 Commerce One

Role & State A Role may have one or more states 17 Commerce One Copyright © 2003

Role & State XML A Role name must be unique within a choreography file

Role & State XML A Role name must be unique within a choreography file <Role name="Seller"> <Description>This role represents the seller of goods or services </Description> <State name="Order. Received"/> <State name="Order. Checked. OK"/> States can also have a. . . Description (not shown) </Role> State names must also be unique within a choreography file 18 Commerce One Copyright © 2003

Message Family name must be unique within a choreography file URN uniquely identifies the

Message Family name must be unique within a choreography file URN uniquely identifies the Message Family <Message. Family name="Order" urn="http: //example. com/Message. Families/Order. Management/Order"> <Description>Messages in this family contain information to convey a request to purchase goods or services </Description> </Message. Family> 19 Commerce One Copyright © 2003

Interaction Definitions Sending Role The name of the Interaction Receiving Role What’s being sent

Interaction Definitions Sending Role The name of the Interaction Receiving Role What’s being sent <Interaction. Def name="Send. Order" from. Role="Buyer" to. Role="Seller" message. Family="Order"> <Description>Send the order From the Buyer to the Seller </Description> <Interaction. End. States from. State="Order. Sent" to. State="Order. Received"/> </Interaction. Def> State of the sending role after the message is sent 20 Commerce One Copyright © 2003 State of the receiving role after the message is received

Interaction End States Receiving Role Sending Role Buyer New Order Created Order Sent From

Interaction End States Receiving Role Sending Role Buyer New Order Created Order Sent From State 21 Seller Commerce One Copyright © 2003 Send Order Received Check Order To State

Choreography Definition Allows one Choreography Definition to be the extension of another Declares a

Choreography Definition Allows one Choreography Definition to be the extension of another Declares a Choreography can only be followed if another choreography has been followed first Identifies the states that indicate the start and end of a choreography Defines the usage of an interaction Interactions and processes can occur in any order 22 Commerce One Copyright © 2003 Defines a process

Choreography Definition (XML) Unique name Unique URN <Choreography. Definition name="Order. Management. Choreography 1" urn="http:

Choreography Definition (XML) Unique name Unique URN <Choreography. Definition name="Order. Management. Choreography 1" urn="http: //example. com/choreographies/Order. Management 1"> <Description>A simple Order Management Choreography that includes the sending of an order from a Buyer to a Seller and the Seller returning an error if a problem is found. </Description> List of start and end states <Start. End. States>. . . List of Interactions </Start. End. States> and Processes in <Interaction. . . /> any order <Process. . . />. . . </Choreography. Definition> 23 Commerce One Copyright © 2003

Start End States A state that indicates the start of the choreography A state

Start End States A state that indicates the start of the choreography A state that may be a last state for a Role in the choreography A state that is a last state for a Role in the choreography 24 Commerce One Copyright © 2003

Start End States example. There is one Start state, but each Role must have

Start End States example. There is one Start state, but each Role must have one or more end states Start State Conditional End State Buyer New Order Created Order Sent End State Seller Order Received Send Order End State Order Error Message Checked Process Order Error Received Check Order Checked OK Order Error Sent Send Order Error End State Order Checked Rejected Order Checked Error End State <Start. End. States> <Start state="New. Order. Created"/> <Conditional. End state="Order. Sent"/> If the Seller finds no problems with the <End state="Order. Checked. OK"/> Order, then Order. Sent is the Buyer’s <End state="Order. Checked. Rejected"/> final state. But if problems are found <End state="Order. Error. Sent"/> then Order. Error. Message. Checked is <End state="Order. Error. Message. Checked"/> the Buyer’s final state </Start. End. States> 25 Commerce One Copyright © 2003

Interactions and Processes A Boolean expression of states that must be true for the

Interactions and Processes A Boolean expression of states that must be true for the Interaction to occur A Boolean expression of states that must be true for the Process to occur A list of the possible end states for a process 26 Commerce One Copyright © 2003

Interaction and Process XML Buyer New Order Created Seller Order Sent Send Order Received

Interaction and Process XML Buyer New Order Created Seller Order Sent Send Order Received Check Order Checked OK Order Checked Rejected Reference to Interaction Definition <Interaction name="Send. Order"> <Description>Send the order to the seller</Description> <Pre. Condition condition="New. Order. Created"/> Role that executes </Interaction> the process <Process name="Check. Order" role="Seller"> <Description>The seller checks the order. </Description> <Pre. Condition condition="Order. Received"/> <Process. End. State state="Order. Checked. OK"/> <Process. End. State state="Order. Checked. Rejected"/> <Process. End. State state="Order. Checked. Error"/> </Process> 27 Commerce One Copyright © 2003 Order Checked Error

Complete Choreography Example <Choreography. Definition name="Order. Management. Choreography 1" urn=“. . . "> <Description>In

Complete Choreography Example <Choreography. Definition name="Order. Management. Choreography 1" urn=“. . . "> <Description>In this Choreography Definition, a Buyer sends an Order to a Seller. The Seller returns an Error Message, if the Order cannot be processed</Description> <Start. End. States> <Start state="New. Order. Created"/> <Conditional. End state="Order. Sent"/> <End state="Order. Checked. OK"/> <End state="Order. Checked. Rejected"/> <End state="Order. Error. Sent"/> <End state="Order. Error. Message. Checked"/> </Start. End. States> <Interaction name="Send. Order"> <Description>Send the order to the seller</Description> <Pre. Condition condition="New. Order. Created"/> </Interaction> <Process name="Check. Order" role="Seller"> <Description>The seller checks the order. </Description> <Pre. Condition condition="Order. Received"/> <Process. End. State state="Order. Checked. OK"/> <Process. End. State state="Order. Checked. Rejected"/> <Process. End. State state="Order. Checked. Error"/> </Process> <Interaction name="Send. Order. Error"> <Description>The order was in error - send an error</Description> <Pre. Condition condition="Order. Checked. Error"/> </Interaction> <Process name="Process. Order. Error. Message" role="Buyer"> <Description>Buyer Processes Order Error Message</Description> <Pre. Condition condition="Order. Error. Received"/> <Process. End. State state="Order. Error. Message. Checked"/> </Process> </Choreography. Definition> 28 Commerce One Copyright © 2003

What’s Missing from the spec § Choreography Bindings to WSDL and SOAP § Handling

What’s Missing from the spec § Choreography Bindings to WSDL and SOAP § Handling errors § e. g. Message (document) errors, Process timeouts, transmission errors, etc § Composing new choreographies out of existing choreographies § Relationships to Reliable Messaging, signals and other protocols such as BTP and WS Transaction § How Imports work § Detailed schema validation rules, e. g. interdependencies § Guidance on how to do run-time checks that a choreography is being correctly followed § Inquiring on another role’s choreography state § Recovering from a failure of the choreography … this list is definitely not complete … 29 Commerce One Copyright © 2003

Issues § Import § Should also allow imports of process definitions § Handling name

Issues § Import § Should also allow imports of process definitions § Handling name conflicts between imports § Roles & States § “name” attributes are “ID’s”, should probably make them unique just within their scope § Roles should also be identified by a URI § Processes § Should be independently defined and importable 30 Commerce One Copyright © 2003