Orchestration, Choreography and Collaboration in Web...
Transcript of Orchestration, Choreography and Collaboration in Web...
| JavaOne 2003 | Session 3176
Orchestration, Choreography and Collaboration in Web Services and ebXML
Ron Ten-HoveStaff Software EngineerSun Microsystems
| JavaOne 2003 | Session 3176 2
Goals
Examine message sequencing in Web Services and Business Web Services
| JavaOne 2003 | Session 3176 3
Ron Ten-Hove
• Staff Engineer, Sun Java™ Web Services Business Integration Product Development─ Developed EAI Products for Forté Software
(now part of Sun Microsystems)─ EAI Web Services─ ebXML BPSS─WSCI─ JSR 208
• Et cetera
| JavaOne 2003 | Session 3176 4
The next important area of developmentof Web Services is so-called Choreography. Many new concepts and specificationsare emerging.
| JavaOne 2003 | Session 3176 5
Agenda
• Definitions
• Abstract Models
• Web Services
• Business Web Services
• Summary
| JavaOne 2003 | Session 3176 6
Service-Oriented Architecture (SOA)
• Services, Services Everywhere
• Business Processes:─ Use Services─ Provide Services
• Useful EAI Approach
• SOAP + WSDL = Web Services
• ebXML Business Web Services
| JavaOne 2003 | Session 3176 7
Some Terminology (WS Flavored)
• Collaboration─ Two or more peers─ Business-oriented goals
• Orchestration─ Running business processes
• Choreography─ Sequencing “interface”─ Client/Server
| JavaOne 2003 | Session 3176 8
Definitions (Cont.)
Trading Partner’sService
Service
Service Service Service
Firewall
Process Engine
| JavaOne 2003 | Session 3176 9
Definitions (Cont.)
Collaboration
Service
Service Service Service
Firewall
Process Engine
Trading Partner’sService
| JavaOne 2003 | Session 3176 10
Definitions (Cont.)
Collaboration
Orchestration
Service
Service Service Service
Firewall
Process Engine
Trading Partner’sService
| JavaOne 2003 | Session 3176 11
Definitions (Cont.)
Collaboration
Orchestration
Choreography
Service
Service Service Service
Firewall
Process Engine
Trading Partner’sService
| JavaOne 2003 | Session 3176 12
Choreography
• Sequencing of Service operations
• Direct dependencies
• Interface─ Observable messages
• Constrains client using Service
| JavaOne 2003 | Session 3176 13
Orchestration
• Process Engine─ Invokes Services─ Offers Services─ Stateful─ Complex rules:
• Sequencing• Concurrent sequences (flows)• Synchronization of flows
• Conforms to Choreography for eachService used
| JavaOne 2003 | Session 3176 14
Collaboration
• B2B (Peer-to-peer)
• Message exchange only
• Like paired services, but─ Uses Internet─ Trading Partner Agreement─ Business Semantics
• Electronic Data Interchange (EDI)
| JavaOne 2003 | Session 3176 15
Abstract Models
• Abstract Models─ Influence Specifications─ Model Checking─ Emphasize certain aspects
• π-Calculus
• Petri Nets
• State Diagrams/Activity Diagrams
| JavaOne 2003 | Session 3176 16
π-Calculus
• Model of concurrent computation
• Interacting, named agents
• Dynamic configuration
• “Calculus of Mobile Processes”
• Influence on newer process specifications
x_y y
_z
z _u
_z
_u
<foo>
<C>B
C
A
| JavaOne 2003 | Session 3176 17
Petri Nets
• Model of concurrent, interacting systems
• Graph of─ Places ─ Transitions─ Directed arcs connecting transitions
and places
• Models ─ Collaboration─ Orchestration
• Good for modeling, not execution
| JavaOne 2003 | Session 3176 18
Petri Nets
| JavaOne 2003 | Session 3176 19
State Machine
• States linked by directed transitions
• More detail than Petri net
• Simple synchronization primitives
• Models ─ Simple orchestration─ Most choreographies
• UML StateChart, Sequential Function Chart, Grafcet, etc.
| JavaOne 2003 | Session 3176 20
State Diagram
Place Order
ArrangeInsurance
BookShipping
| JavaOne 2003 | Session 3176 21
Activity Diagrams
• UML variation of State Machine
• Roles (“Swim lanes”)
• Initiating role
• Message exchange between roles
• Models─ Collaboration─ Orchestration (optionally)
| JavaOne 2003 | Session 3176 22
Activity Diagrams
Buyer Seller
et cetera...
Send QuoteRequest
AcceptReceipt
AcceptReceipt
SendReceipt
| JavaOne 2003 | Session 3176 23
Web Services
• Technology stack
• Based on web protocols
• Port 80 as a tunnel
• SOAP 1.1─ RPC─ Message exchange
• WSDL 1.1─ Description of service─ Bind service to SOAP
Application
SOAP
HTTP
TCP
IP
Datalink
Physical
| JavaOne 2003 | Session 3176 24
The Problem With Web Services
• Web Services Description Language 1.1─ Operations, Operations Everywhere─ Services modeled as message exchanges─ Unordered
• No Choreography
• No Collaboration─ Paired services pattern
• Orchestration: Not applicable
| JavaOne 2003 | Session 3176 25
WSDL Structure
Adapted from: Microsoft MSDN
Part Part Part Part
Operation
Binding
Service
...
...
...
Message Message
Port Type
Port ...
| JavaOne 2003 | Session 3176 26
WSDL Structure
Adapted from: Microsoft MSDN
Part Part Part Part
Operation
Binding
Service
...
...
...
Message Message
Port Type
Port ...
Abstract Endpoint
Type
| JavaOne 2003 | Session 3176 27
WSDL Structure
Adapted from: Microsoft MSDN
Part Part Part Part
Operation
Binding
Service
...
...
...
Message Message
Port Type
Port ...
Abstract Endpoint
Type
Concrete Endpoint
| JavaOne 2003 | Session 3176 28
WSDL Structure
Adapted from: Microsoft MSDN
Part Part Part Part
Operation
Binding
Service
...
...
...
Message Message
Port Type
Port ...
Abstract Endpoint
Type
Concrete Endpoint
Endpoint Instance
| JavaOne 2003 | Session 3176 29
WSDL Structure
Adapted from: Microsoft MSDN
Part Part Part Part
Operation
Binding
Service
...
...
...
Message Message
Port Type
Port ...
Abstract Endpoint
Type
Concrete Endpoint
Endpoint Instance
| JavaOne 2003 | Session 3176 30
Web Service Choreography
• Layered on top of PortType─ Reuse
• Client/Service contract
• Ordering of Operation invocations
| JavaOne 2003 | Session 3176 31
Open forRead
Idle
Open forUpdate
Choreography Example
LoginAdmin()
LoginUser()
Update()
Read()
LogOff()
LogOff()
Read()
| JavaOne 2003 | Session 3176 32
Simple Choreography Isn’t Enough
• Pure Client/Service─ Only one initiator─ Synchronous Messaging
• Single Service Only
| JavaOne 2003 | Session 3176 33
Specifications to the Rescue
• WSCL 1.0─ Basic choreography language─ Layered directly atop WSDL 1.1
• WSCI 1.0─ Rich choreography language─ Layered directly atop WSDL 1.1
• BPEL4WS─ Broad orchestration language─ Choreography support─ Layered directly atop WSDL 1.1
| JavaOne 2003 | Session 3176 34
Added Features
• Correlation
• Transactions
• Exceptions
• Compensation
• Roles
• Dynamic Participation
| JavaOne 2003 | Session 3176 35
Correlation
• Asynchronous responses─ How to correlate to request?
• ebXML message meta-data─ Unique message IDs─ Ref-to message ID
• Use message content─ E.g., purchase order number
• Multiple correlation items possible
| JavaOne 2003 | Session 3176 36
Send PurchaseOrder
SendInvoice
ShipGoods
SendPayment
AcceptInvoice
AcceptPO
Correlation Example
Buyer Seller
/po/head@no
/inv/ref/po/inv/id/num
/pay/ref/inv
| JavaOne 2003 | Session 3176 37
Transactions
• Multiple operations complete or fail likea single one
• Various models:─ ACID—Atomic
• Locks resources• Costly for long-running operations
─ Nested (Open)• Relaxes isolation requirement• Complex error recovery
• In tension with loose coupling
| JavaOne 2003 | Session 3176 38
Exceptions
• Choreography distinguishes:─ “Happy path”─ Error paths
• Technical problems• Fault response from Service– Multiple types
• Error paths can─ Retry─ Complain─ Clean up
| JavaOne 2003 | Session 3176 39
Compensation
• Undo a committed transaction/operation─ Needed in open transaction model─ Distinct from rollback
• Explicit compensation handler─ Sequence of operations to achieve “undo”
| JavaOne 2003 | Session 3176 40
Roles
• Assigning role names to port types
• Pairing roles─ E.g., Buyer, Seller─ Links port types directly
| JavaOne 2003 | Session 3176 41
Dynamic Participation
• Selection of target service at run-time
• Uses dynamic data─ Message contents─ Previous message contents
• π-Calculus influence─ Service address is a channel─ Port type is channel type
| JavaOne 2003 | Session 3176 42
Business Web Services
Firewall
Trading Partner’sServices
Service
Service Service Service
ProcessEngine
Business ServicesInterfaces
Business ServicesInterfaces
| JavaOne 2003 | Session 3176 43
Business Web Services
• Web Services Plus:─ Reliability─ Security─ Direct support for business semantics
• EDI—Electronic Data Interchange─ Electronic business documents─ Many data formats─ Value Added Network—VAN─ Expensive
| JavaOne 2003 | Session 3176 44
Business Web Services
• Binary or multi-party collaborations
• Complex sequencing
• Trading partner agreements (contracts)
• Peer-to-peer shared views:─ State management─ Business semantics, rules, constraints
• Integration with internal business systems:─ Business processes─ Applications
| JavaOne 2003 | Session 3176 45
Business Web Services Are Different
• B2B Transactions─ Coarse-grained
• Map to business activities─ Have economic and legal consequences─ No shared infrastructure
• Internet─ Insecure─ Unreliable─ Ubiquitous, cheap
| JavaOne 2003 | Session 3176 46
ebXML for Business Web Services
• “Cheap” EDI:─ Internet protocols
• Reliable, secure messaging atop SOAP─ XML for data─ Standard business documents:
• CC—Core Components• UBL—Universal Business Language
─ Standards based, interoperable
| JavaOne 2003 | Session 3176 47
ebXML for Business Web Services
• Suite of loosely-coupled specifications─ CPP/CPA
• Trading partner agreement─ Message Handler
• Secure, reliable messaging over Internet• CPA configures handler quality-of-service
for each transaction─ BPSS
• Binary and multi-party collaboration• Business transaction model
─ Core Components, UBL
| JavaOne 2003 | Session 3176 48
CPP/CPA
• Ultimate WSDL
• Trading partner agreement─ Roles assigned to partners─ All messages described─ Endpoints defined─ All message exchanges defined
• Quality of service– Security– Reliability
| JavaOne 2003 | Session 3176 49
Message Handler
• Configured by CPA(s)
• Provides ─ Security
• Confidential• Tamper-proof• Authentication of sender
─ Reliability• Once-and-only-once delivery
• Interoperable─ Many implementations available
| JavaOne 2003 | Session 3176 50
BPSS
Business Process Specification Schema─ Collaborative business process definition
• Role-based• Binary and multi-party
─ Defined atop abstract model of MSH─ Shared view of process state
• Message exchange– business signal protocol
• Common process definition─ Rich set of business-oriented features
| JavaOne 2003 | Session 3176 51
BPSS
• Process models similar to UML Activity Diagrams─ Stereotyped activity “Business Transaction”
• Business protocol– Multiple document exchanges– Time outs
• Simple set of result types – Succeeded, – Failed for technical reasons, failed for business
reasons, etc.─ Roles mapped to swim lanes─ Concurrent activities
| JavaOne 2003 | Session 3176 52
BPSS Example
Buyer Seller
Get Quote
Let PurchaseOrder
SendPayment
Send ShipmentData
IssueInvoice
SendShip Notice
Success
| JavaOne 2003 | Session 3176 53
Quality of Service:Security, Reliability
Quote Request
Receipt
Acceptance
Quote
Receipt
Acceptance
Business Transaction Activity: Get Quote
Buyer Seller
BusinessWeb
ServiceInterface
BusinessWeb
ServiceInterface
Mes
sag
e H
and
ler M
essage H
and
ler
| JavaOne 2003 | Session 3176 54
Summary
Service
Service Service Service
Firewall
Process Engine
Trading Partner’sServices
| JavaOne 2003 | Session 3176 55
Summary
WSCIWSCL
Service
Service Service Service
Firewall
Process Engine
Trading Partner’sServices
| JavaOne 2003 | Session 3176 56
Summary
ebXML
WSCIWSCL
Service
Service Service Service
Firewall
Process Engine
Trading Partner’sServices
| JavaOne 2003 | Session 3176 57
Summary
ebXML
BPEL4WSBPML
WSCIWSCL
Service
Service Service Service
Firewall
Process Engine
Trading Partner’sServices
| JavaOne 2003 | Session 3176 58
Summary
• Distinct technical meanings─ Collaboration─ Orchestration─ Choreography
• Abstract models ─ Help understand specifications─ Help drive specifications
| JavaOne 2003 | Session 3176 59
Summary
• Web Services─ Service-oriented architecture─WSDL
• Simple structure• Everybody is “fixing” it
─ Expanding Orchestration/Choreography features:• Correlation• Transactions/Exceptions/Compensation• Roles• Dynamic participation
| JavaOne 2003 | Session 3176 60
Summary
• Business Web Services─ Different from Web Services─ EDI by Internet─ ebXML provides
• Reliable, secure messaging• Trading partner agreements• Shared business processes• Business semantics
| JavaOne 2003 | Session 3176 61
If You Only Remember One Thing…
We don’t have a Web Servicessilver bullet.
Different solutions are needed in different parts of an enterprise’s EAI and B2B structures.
Q&A