Document 13353425

advertisement

2

Web Services

Choreography Description

Language (WS-CDL)

Guus Ramackers

Senior Principal Product Manager

Application Development Tools

Oracle Corporation

Based on presentation by Nick Kavantzas, Oracle, editor CDL spec, W3C Choreography WG

3

Agenda

y

Goal

y

Choreography and Orchestration

y

Web Services Platform

y

WS-CDL Core Concepts

y

Example

4

Goal

y Specify a declarative language that describes collaborations of Web Services participants by defining their externally observable behavior as part of an inter-organizational transaction y Based on a formal model

– pi-calculus variation

5

Sample Business Process:

Purchase Order

Sample Purchase Order

Purchase Order Request

Business

“ A ” Purchase Order Acknowledgement

Business

“ B ”

Purchase Order Response

6

From a Choreography

Perspective

Public Process

Business A

Send

PO

PO Request

Receive PO

Ack

PO Acknowledgement

Receive PO

Response

PO Response

Business B

Receive

PO

Send

PO Ack

Send PO

Response

Choreography – The observable public exchange of messages

7

From an Orchestration

Perspective

From ERP

To ERP

Private Process

Business A BPEL Workflow

Transform

Send

PO

Transform

PO Request

Receive PO

Ack

PO Acknowledgement

Receive PO

Response

PO Response

Orchestration – A private executable business process

8

Orchestration and

Choreography Together

Generate BPEL

Template

Business Analyst Tool

Business

A

Business

B

Generate BPEL

Template

Business A BPEL Workflow

Transform

Send

PO

Business B BPEL Workflow

Receive

PO

Transform

PO Request

Transform

Receive PO

Ack

PO Acknowledgement

Send PO Ack

Receive PO

Response

PO Response

Receive PO

Response

Two BPEL workflow templates reflecting a business agreement

Transform

Current Web Services platform

y

Core communication framework bridging heterogeneous computational models

Loosely-coupled, stateless

Exchange of type checking information

9

HTTP , BEEP,IIOP, JMS, SMTP

Emerging Web Services platform

Business Collaboration Language: Web Services Integration

10

HTTP , BEEP,IIOP, JMS, SMTP

11

WS-CDL Concepts

y Web Services participants interact and align their shared information

Synchronized document exchanges (state)

Progress is guarded by commonly defined ordering rules y Set of Interactions are combined to form a behavioral unit (choreography)

Enables re-usability in different business contexts

WS-CDL Concepts

12 y Information Typing

Document Type

Token

Locator y Identifying & Coupling of WS participants

Role

Relationship y Information driven collaboration

Channel

State

Activity

Reaction (a.k.a. Rule)

Choreography

WS-CDL Example

13 y The example is a multi-participant choreography y Illustrates a simple purchase sequence y It involves four participants, Roles

Buyer, Seller, Credit Checking Service, and Inventory

Service y Main choreography involves 3 relationships

Buyer-Seller

Seller-Credit Checking Service

Seller-Inventory Service

WS-CDL Example cont.

14 y The Buyer initiates an interact with the Seller to align the Purchase Order y The Seller, when the Purchase Order is available, initiates 3 interactions

With the Buyer to acknowledge receipt of the Purchase

Order

With the Credit Checking Service to check Buyers credit

With the Inventory Service for product availability y Seller Response

The Seller reaction is guarded by the response interactions from Credit Checking Service and Inventory Service y If both interactions result are positive, the order is processed and the Purchase Order Response is sent y If either interaction indicate a negative result a

Purchase Order Reject message is sent to the Buyer

WS-CDL Example cont.

Buyer

PurchaseOrder

Seller createOrder

1

PurchaseOrder

PurchaseOrderAck

2 createOrderAck

PurchaseOrderAck

PurchaseOrderResp purchaseOrderResp

PurchaseOrderResp

5

15

Channels

Guards

Legend

Credit inventoryCheck

InvCheckReq

CheckCreditReq creditCheck

CheckCreditReq

3

CheckCreditResp createCheckResp

CheckCreditResp

4 inventoryCheckResp

InvCheckResp

Inventory

InvCheckReq

InvCheckResp

3

Information Typing

16 y Document type

Aliases WSDL message type, XSD type, XSD element

Supports future type systems y Token type

Specify name and type of piece of information y Uses WS-CDL Document type of the attribute y Token Locater type

Specify rules for selecting a piece of information y WS-CDL Document type y WSDL message part y XPATH query of document

17

WS-CDL Example cont.

Documents

<documentType name="purchaseOrderDocType" messageType="pons:purchaseOrderMsg"/>

<documentType name="purchaseOrderAckDocType“ messageType="pons:purchaseOrderAckMsg"/>

18

WS-CDL Example cont.

Tokens

<tokenType name=“warehouseRef" type="xsd:anyUri"/>

<tokenType name="purchaseOrderID" type="xsd:int"/>

<tokenLocator tokenName="sns:purchaseOrderID" documentType ="purchaseOrderDocType" part="PO" query="/PO/Order"/>

19

Static coupling:

Roles & Relationships

y

Role type

Specify the observable behavior, in terms of the operations, a WS participant can perform y One or more WSDL interface type(s) named as behavior type y

Relationship type

Specify the mutual commitments, in terms of the

Roles, two WS participants are required to provide y Two WSDL interface types

20

WS-CDL Example cont.

roleType

<roleType name="Seller">

<behaviorType name="sellerForBuyer" interfaceType="sns:SellerPOPT"/>

<behaviorType name="sellerForCredit" interfaceType="sns:SellerCreditPT"/>

</roleType>

21

WS-CDL Example cont.

Relationships

<relationshipType name="BuyerSellerBinding">

<role type="Buyer"/>

<role type="Seller"/>

</relationshipType>

22

Dynamic coupling:

Channel

y Identify a contact-point, through which two WS participants interact

– the service type of a participant, using Token type(s) within a reference marker the business process type implementing a WS participant, using Token type(s) within an identity marker y Identify a conversation between two or more WS participants

A conversation groups a set of related document exchanges, using Token type(s) within an identity marker

23

WS-CDL Example cont.

Channels

<channelType name="purchaseOrderCHT">

<channelDefinitions>

<channel type= ” purchaseOrderResponseCHT ” direction= “ respond ” >

</channelDefinitions>

<role type="Seller"/>

<reference>

<token name="warehouseRef"/>

</reference>

<identity>

<token name="purchaseOrderID"/>

</identity>

</channelType>

24

State

y Capture information shared between WS participants

Affect the progress of their common business transaction y State definitions

Define Documents y Typed with a documentType

Define Channels y Typed with a channel type

Specify the Role of the WS participant the state resides in

25

WS-CDL Example cont.

State Definitions

<stateDefinitions name="purchaseOrderChoreographyState">

<stateType name="purchaseOrderAckDoc" documentType="purchaseOrderAckDocType"/>

<stateType name="purchaseOrderDocAtBuyer" documentType="purchaseOrderDocType" roleType="Buyer"/>

</stateDefinitions>

26

Activities: Interact

y Enable WS participants to communicate and align their shared state

Align state that resides in one role with state that resides in the other role y Synchronized document exchange between two roles within a relationship

Atomic, request & accept of an operation through a channel y WSDL One way or request-response y Information flow

- request direction: fromRole towards toRole

- response direction: toRole towards fromRole

27

WS-CDL Example cont.

Interacts

<interact name="inventoryCheck" onChannel="inventory-channel" operation="inventoryCredit" initiateChoreography="true">

<participate relationship="SellerInventoryBinding" fromRole="Seller" toRole="Inventory"/>

<align state="inventoryRequestDoc" with-state="inventoryRequestDoc"/>

</interact>

28

Reaction

y Guard a set of activities

Express interest on the availability of one or more state information

When the state is/become available and a guard condition evaluates to true, the enclosed activities are enabled y In parallel or sequentially y Repeat: marks the re-enablement of a reaction y Choice: enables the mutual-exclusive enablement of a set of reactions

29

WS-CDL Example cont.

Reactions

<react name="creditApprovalInventoryApproval" group="ApproveOrReject“ relationshipType=”BuyerSellerBinding” guard=

"cdl:getState(CreditCheckResponseDocAtSeller,

\“/Customer/Credit\”)[text() = 'success'] && cdl:getState(InventoryResponseDocAtSeller,

\“/Order/Inventory\”)[text()='available']">

<interact name="createOrderResponse“ … />

</react>

30

WS-CDL Example cont.

Reactions

<react name="creditApprovalInventoryApproval“ …>

<interact name="createOrderResponse“ … />

</react>

<react name="creditApprovalInventoryApproval“ …>

<sequence>

<interact name="createOrderResponse“ … />

<interact name="createOrderResponse“ … />

</sequence>

</react>

<react name="creditApprovalInventoryApproval“ …>

<parallel>

<interact name="createOrderResponse“ … />

<interact name="createOrderResponse“ … />

</parallel>

</react>

Choreography

31 y Interactions with common behavioral characteristics are combined to form a behavioral unit

Enumerate all the binary relationships interactions act in

Localize the visibility of state y Using state definitions

Prescribe alternative patterns of behavior y Using reactions

Enable Recovery y Backward: handle exceptional conditions y Forward: compensate already completed activities y Recursively combine Choreographies to form new

Choreographies

32

WS-CDL Example cont.

<choreography name="purchaseOrderChoreograpy" root="true">

<choreography name="buyerSellerChoreography”>

<interact name="createOrderInteract“/>

<interact name="createOrderAckInteract“/>

<choreography name="sellerResponseChoreography">

<interact name="createOrderResponse“/>

</choreography>

<choreography name="sellerRejectChoreography">

<interact name="createOrderReject“/>

</choreography>

</choreography>

<choreography name=“creditCheckChoreography”>

<interact name="creditCheck“/>

<interact name="creditCheckResponse“/>

</choreography>

<choreography name="inventoryCheckChoreography">

<interact name="inventoryCheck“/>

<interact name="inventoryResponse“/>

</choreography>

</choreography>

33

Summary

• WS-CDL describes XML schema for capturing the contract between multiple parties y Choreography complements Orchestration y Core concepts are Activity, State and Reaction y Spec under development in W3C Choreography WG

– Please download and comment if you are interested y Choreography and Orchestration standards needed for next generation Web Services platform

Download