Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

43
π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies

Transcript of Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

Page 1: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

Dancing with Services

10th January 2005

Steve Ross-Talbot

Pi4 Technologies

Page 2: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

Agenda

• Choreography

• WS-CDL

• Tools

• The future

Page 3: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4Choreography - the beginning

• Working Group formed January 2003

• Initially tasked with defining business processes (aka BPML and BPEL) in a Web Service context

• Focus became a behavioral contract language for distributed systems

Page 4: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

Choreography - milestones

• Requirements document published in

• Invited experts (Milner, Honda, Yoshida) joined in

• Published first draft of WS-CDL in

• Published last call draft of WS-CDL in

• Published candidate recommendation draft of WS-CDL in

• Published working draft of WS-CDL primer in

Page 5: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

Choreography - today

• Primer likely to be published as a working note end Q1 2006

• Formal underpinnings likely to be published as a working note Q22006

• Implementations …..– Pi4 Technologies (www.pi4soa.org)– Imperial College– Trustcom– One other

• Users ….– 3 vertical standards organisations– 2 Banks– 1 Telco

Page 6: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL

• An XML language for describing the behavioral contract of collections of peered services in order to achieve some goal

• Akin to UML sequence diagrams with no ambiguities and a robust behavioral type system

Page 7: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Structure

Participants, Roles, Relationships, Information, Channels

Choreography, Interaction

WorkUnits, Structured composition

Non Observable Conditionals

Observable Conditionals

State MgmtNo State Mgmt

Package

Page 8: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - An example

Page 9: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - An example<interaction name="Buyer accepts the quote and engages in the act of buying" operation="quoteAccept” channelVariable="Buyer2SellerC">  < description type="description">Quote Accept </description>  < participate relationshipType="BuyerSeller" fromRole="BuyerRoleType " toRole="SellerRoleType" /> <exchange name="Accept Quote " informationType="QuoteAcceptType " action="request"></exchange></interaction>

< interaction name="Buyer send channel to seller to enable callback behavior" operation="sendChannel " channelVariable="Buyer2SellerC"> < description type="description">Buyer sends new channel to pass on to shipper</description>  < participate relationshipType="BuyerSeller" fromRole="BuyerRoleType " toRole="SellerRoleType" /> <exchange name="sendChannel " channelType="2BuyerChannelType " action="request"> <send variable="cdl:getVariable('DeliveryDetailsC','','')" /> <receive variable="cdl:getVariable('DeliveryDetailsC','','')" /> </exchange></interaction>

< interaction name="Seller requests delivery details - passing channel for buyer and shipper to interact" operation="requestShipping”channelVariable="Seller2ShipperC"> <description type="description">Request delivery from the shipper</description> <participate relationshipType="SellerShipper" fromRole="SellerRoleType" toRole="ShipperRoleType " /> <exchange name="sellerRequestsDelivery" informationType="RequestDeliveryType " action="request"></exchange> <exchange name="sellerReturnsDelivery" informationType="DeliveryDetailsType" action="respond "></exchange></interaction>

< interaction name="Shipper forward channel to shipper" operation="sendChannel " channelVariable="Seller2ShipperC"> <description type="description">Pass channel from buyer to shipper</description> <participate relationshipType="SellerShipper" fromRole="SellerRoleType" toRole="ShipperRoleType " /> <exchange name="forwardChannel " channelType="2BuyerChannelType " action="request">  < send variable="cdl:getVariable('DeliveryDetailsC','','')" />  < receive variable="cdl:getVariable('DeliveryDetailsC','','')" />  </exchange></interaction>

< interaction name="Shipper sends delivery details to buyer" operation="deliveryDetails" channelVariable="DeliveryDetailsC"> <description type="description">Pass back shipping details to the buyer</description> <participate relationshipType="ShipperBuyer " fromRole="ShipperRoleType " toRole="BuyerRoleType " /> <exchange name="sendDeliveryDetails" informationType="DeliveryDetailsType" action="request"></exchange></interaction>

Page 10: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - An example<?xml version="1.0" encoding="UTF-8" ?><package name="BuyerSellerCDL" author="Steve Ross-Talbot "version="1.0" targetNamespace="www.pi4tech.com/ cdl/ BuyerSeller"xmlns="http://www.w3.org/2004/12/ ws-chor/ cdl"xmlns:bs="http://www.pi4tech.com/ cdl/ BuyerSellerExample-1"><description type="description">This is the basic BuyerSeller Choreography Description</description>

…………

<choreography name="Main " root="true">  < description type="description">Collaboration between buyer, seller, shipper, credit chk</description>

…………

< sequence> < interaction name="Buyer requests a Quote - this is the initiator" operation="requestForQuote " channelVariable="Buyer2SellerC" initiate="true">  < description type="description">Request for Quote</description>

  < participate relationshipType="BuyerSeller" fromRole="BuyerRoleType " toRole="SellerRoleType" /> < exchange name ="request" informationType="RequestForQuoteType " action="request">  < description type="description">Requesting Quote </description>  </exchange> <exchange name ="response " informationType="QuoteType " action="respond ">  < description type="description">Quote returned </description>  </exchange> </interaction>

…………

</sequence> </choreography></package>

Page 11: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - An example <workunit name="Repeat until bartering has been completed" repeat="barteringDone = false"> <choice> < silentAction roleType="BuyerRoleType ">  < description type="description">Do nothing - let the quote timeout</description> </silentAction>

< sequence> < interaction name="Buyer accepts the quote and engages in the act of buying" operation="quoteAccept " channelVariable="Buyer2SellerC"> < description type="description">Quote Accept </description> < participate relationshipType="BuyerSeller" fromRole="BuyerRoleType " toRole="SellerRoleType" /> < exchange name="Accept Quote " informationType="QuoteAcceptType " action="request">  </exchange>   </interaction> < interaction name="Buyer send channel to seller to enable callback behavior" operation="sendChannel " channelVariable="Buyer2SellerC">   < description type="description">Buyer sends channel to pass to shipper</description>   < participate relationshipType="BuyerSeller" fromRole="BuyerRoleType " toRole="SellerRoleType" /> < exchange name="sendChannel " channelType="2BuyerChannelType " action="request">   < send variable="cdl:getVariable('DeliveryDetailsC','','')" />   < receive variable="cdl:getVariable('DeliveryDetailsC','','')" />   </exchange>   </interaction> < assign roleType="BuyerRoleType ">   < copy name="copy ">   < source expression="true" />   < target variable="cdl:getVariable('barteringDone','','')" />   </copy>   </assign>   </sequence>

< sequence> < interaction name="Buyer updates the Quote - in effect requesting a new price" operation="quoteUpdate " channelVariable="Buyer2SellerC">   < description type="documentation ">Quot Update </description>   < participate relationshipType="BuyerSeller" fromRole="BuyerRoleType " toRole="SellerRoleType" /> < exchange name="updateQuote " informationType="QuoteUpdateType " action="request">   </exchange> <exchange name="acceptUpdatedQuote " informationType="QuoteAcceptType " action="respond ">   < description type="documentation ">Accept Updated Quote </description>   </exchange>   </interaction>   </sequence> </choice> </workunit>

Page 12: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - An example<parallel> <workunit name="Check Credit Rating"> < sequence> < interaction name="Seller check credit with CreditChecker" operation="creditCheck" channelVariable="Seller2CreditChkC">  < description type="description"> Check the credit for this buyer with the credit check agency </description>  < participate relationshipType="SellerCreditCheck" fromRole="SellerRoleType" toRole="CreditCheckerRoleType " /> <exchange name ="checkCredit" informationType="CreditCheckType " action="request"></exchange>  </interaction>

<choice> <sequence>   <interaction name="Credit Checker fails credit check" operation="creditFailed" channelVariable="Seller2CreditChkC">   < description type="description">Credit response from the credit checking agency </description>  < participate relationshipType="SellerCreditCheck" fromRole="SellerRoleType" toRole="CreditCheckerRoleType " /> <exchange name ="creditCheckFails" informationType="CreditRejectType" action="respond "></exchange>  </interaction> <assign roleType="SellerRoleType">  < copy name="copy ">  < source expression="false" />  < target variable="cdl:getVariable('creditRatingOk','','')" />  </copy>  </assign> </sequence>  

<sequence>   <interaction name="Credit Checker passes credit" operation="creditOk" channelVariable="Seller2CreditChkC">   < description type="description">Credit response from the credit checking agency</description>  < participate relationshipType="SellerCreditCheck" fromRole="BuyerRoleType " toRole="CreditCheckerRoleType " /> <exchange name ="creditCheckPasses " informationType="CreditAcceptType " action="respond "> </exchange>  </interaction> <assign roleType="SellerRoleType">  < copy name="copy ">   < source expression="true" />  < target variable="cdl:getVariable('creditRatingOk','','')" />  </copy>  </assign> </sequence>   </choice> </sequence>   </workunit>

<workunit name ="Request Delivery" guard="creditRatingOk = true" blocking="true"> ……  </workunit></parallel>

Page 13: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Structural clarityBlocking

Workunit (G) (R) (B is True)Body

Where G => guard condition, R => repeat condition, B => blocking attribute, Body => CDL activities within the work unit

A typical order of evaluation is as follows:(G) Body (R G) Body (R G) Body

With respect to a G then the G is only evaluated when the variables are available and evaluate to True and otherwise wewait at the guard condition. Thus the Body after the first G only gets executed when G is True. Or put another way Body isprimed ready for action and then is executed when G evaluates to True.

IF G is unavailable or evaluates to False THEN it equates to:when (G) {

Body} until (!R)

IF G is always True THEN it equates to:repeat {

Body} until (!R)

IF R is always False THEN it equates to:when (G) {

Body}

Page 14: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Structural clarityNon-blocking

Workunit (G) (R) (B is False)Body

A typical order of evaluation is as follows:

(G) Body (R G) Body (R G) Body

Which equates to (in pseudo code):

while (G) {Body

} until (!R)

IF G is always True THEN it equates to:

repeat {Body

} until (!R)

IF R is always False THEN it equates to:

if (G) {Body

}

Page 15: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?

GatewaySvc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

The dancers:Are the services in an

SOA

The dance steps: Are the interactions

Page 16: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Gateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

C’ptySvc

RefDataSvc

Post-tradeSTP Example

Gateway svc asks Validation svc to validate trade

Page 17: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Gateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

C’ptySvc

RefDataSvc

Post-tradeSTP Example

Validation svc asks RefData svc to lookup various components as part of validation

Page 18: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Once validation is complete Validation svc informs Gateway svcGateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

C’ptySvc

RefDataSvc

Post-tradeSTP Example

Page 19: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Gateway svc asks Transaction svc to persist the validated tradeGateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

C’ptySvc

RefDataSvc

Post-tradeSTP Example

Page 20: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Transaction svc stores trade in RepositoryGateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

C’ptySvc

RefDataSvc

Post-tradeSTP Example

Page 21: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Gateway svc asks Cashflow svc and Confirm svc to execute in parallelGateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

C’ptySvc

RefDataSvc

Post-tradeSTP Example

Page 22: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Confirm svc communicates with various other svc’s

GatewaySvc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

C’ptySvc

RefDataSvc

Post-tradeSTP Example

Page 23: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?RefData svc could have returned a fault to the Validation svc because a counterparty was invalidGateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

Page 24: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?As a result of a fault the Validation svc sends the Exception svc a message to alert someone of the problem.

GatewaySvc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

Page 25: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Which may get fixed in-situGateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

Page 26: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?And so validation is repeated

GatewaySvc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

Page 27: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?The Gateway svc is unaware that problems occurred and were fixed.Gateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

Page 28: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?But the Exception svc might not be able to fix the problem. It sends a fault back to the Validation svc

GatewaySvc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

Page 29: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?Which enables an exception block in which a further message is sent from the Validation svc to the Exception svc to inform someone of a major problem.

GatewaySvc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

Page 30: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Can I dance?And the conversation over the services is terminatedGateway

Svc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

Page 31: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4WS-CDL - I can’t dance because …

Gateway Validation RefData Exception

Validation succeeds

Page 32: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4WS-CDL - I can’t dance because …

Gateway Validation RefData Exception

Validation succeeds after a fix

Page 33: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4WS-CDL - I can’t dance because …

Gateway Validation RefData Exception

Validation fails terminating the conversation

The dance steps are incomplete.There are too many pages of instructions.

Page 34: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - I can dance

GatewaySvc

ValidationSvc

EnrichmentSvc

TransactionSvc

CashflowSvc

ConfirmSvc

ApprovalSvc

BusRulesSvc

DocumentMgmtSvc

ExceptionSvc

CptySvc

RefDataSvc

Post-tradeSTP Example

C

C

?

?

?

?

C

C

?

?

?

?

C

C

?

?

?

?

Gateway behaviour

C

C

?

?

?

?

Validation behaviour

C

C

?

?

?

?

RefData behaviour

C

C

?

?

?

?

Exception behaviour

Page 35: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Tools

• Open Source www.pi4soa.org Eclipse plugins– Validating editor (graphical and tree based)– Behavioral Monitoring– CDL2Java (1.4, 1.5), CDL2BPEL (1.X, 2.0) , CDL2WSDL (1.1, 2.0), CDL2EPP

• Project members– Steve Ross-Talbot, Gary Brown (lead), Nobuko Yoshida, Kohei Honda,

Marco Carbone, Robin Milner, Charlton Barretto

• Custodian www.pi4tech.com– A new way to engage with academia– Royalty free– IP free

Page 36: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Tools

Graphical Grammar

Page 37: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Tools

Graphical Grammar

Page 38: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Tools

Graphical Grammar

Page 39: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Tools

Graphical Grammar

Page 40: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - Tools

Code Generation

and Deployment

Page 41: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - ToolsBehavioral Monitor

Page 42: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

WS-CDL - The future

• Round tripping (Java2CDL and CDL2Java)

• Liveness properties

• Bisimulation (for conformance)

Page 43: Π4π4 Dancing with Services 10th January 2005 Steve Ross-Talbot Pi4 Technologies.

π4

The End