Professional Documents
Culture Documents
Web Web
Service 2 Service 5
Web Web
Service 3 Service n
Example Problem Space
reeddiitt e
Cr ocnks
C
ReC
shpe Credit
Service
Purchase
Invoice
Consolidate
Order Results
InR
v
PO Service RIen eensteo
svpe rrvye
Client onnt
sery
o
Inventory
Service
Business Process Challenges
Business Business
“A” Purchase Order Acknowledgement “B”
Business A Business B
Send Receive
PO PO Request PO
Receive PO Send
Ack PO Ack
PO Acknowledgement
Receive PO Send PO
Response Response
PO Response
Send
Transform
PO PO Request
From ERP
Receive PO
Ack PO Acknowledgement
To ERP
Receive PO
Transform
Response
PO Response
Receive PO Receive PO
Transform Transform
Response Response
PO Response
Transactions
Quality of
WS-Reliability WS-Security Coordination
Management
Service
Context
UDDI Discovery
WSDL Description
Description
SOAP
Message
XML
Binding
Type
BPEL Scenario Structure
<process>
<!– Definition and roles of process participants -->
<partnerLinks> ... </partnerLinks>
<!- Data/state used within the process -->
<variables> ... </variables>
<!- Properties that enable conversations -->
<correlationSets> ... </correlationSets>
<!- Exception handling -->
<faultHandlers> ... </faultHandlers>
<!- Error recovery – undoing actions -->
<compensationHandlers> ... </compensationHandlers>
<!- Concurrent events with process itself -->
<eventHandlers> ... </eventHandlers>
<!- Business process flow -->
(activities)*
</process>
BPEL Activities
Process
Customer <variable> <activity> <activity> <variable> Customer
Service <A> <B> Service
y Receive
– Wait for a partner inbound message
– Can be the instantiator of the business process
y Reply
– Synchronous response to a receive activity
– Response to the inbound receive from a partner
y Invoke
– Issue a request synchronously *or* asynchronously
y Pick
– Specify an inbound set of messages
– Can be the instantiator of the business process
– Activity completes when one of the messages arrives
Simple Activities Combined
with Structured Activities
Receive <PO> <sequence>
Customer Seller
• SendPurchase • AsynchPurchase
POResponse
• ProcessPurchaseResponse • AsynchPurchaseResponse
Correlations:
<PO_CustId = 10>
initiate=no <PO_OrdId = 100> initiate=no pattern=out
<Inv_VendId = 20>
initiate=yes <Inv_InvId = 200> initiate=yes pattern=out
Correlations in BPEL
<correlationSets>
<correlationSet name="POCorr" properties="cor:custId cor:ordId"/>
<correlationSet name="InvoiceCorr" properties="cor:vendId cor:invId"/>
</correlationSets> ...
<receive partnerLink=“Customer” portType="SP:PurchaseOrderPT"
operation="AsynchPurchase" variable="PO">
<correlations>
<correlation set="POCorr" initiate="yes">
</correlations>
</receive> ...
<invoke partnerLink=“Customer” portType="SP:CustomerPT"
operation=“ProcessPurchaseResponse" inputVariable="POResponse">
<correlations>
<correlation set="POCorr" initiate="no" pattern="out">
<correlation set="InvoiceCorr" initiate="yes" pattern="out">
</correlations>
</invoke> ...
Scopes in BPEL
<scope
y Provide a shared variableAccessSerializable="yes|no“
...>
context for subset of
<variables>
activities </variables>
y Can contain <correlationSets>? ...
– fault handlers </correlationSets>
– event handlers, <faultHandlers>
– compensation handler </faultHandlers>
variables <compensationHandler>? ...
– correlation sets </compensationHandler>
</scope>
Long Running Transactions
and Compensation
<scope> CreditService
Charge • CheckCredit
Hold Fee • ChargeHoldFee
Undo
• CancelHoldFee
InventoryService
Reserve
• ReserveInventory
Inventory Undo
• CancelReserveInv
</scope>
Compensation Handlers
in BPEL
<scope>
<compensationHandler>
<invoke partnerLink="Seller" portType="SP:Purchasing"
operation="CancelPurchase"
inputVariable="getResponse"
outputVariable="getConfirmation">
<correlations>
<correlation set="PurchaseOrder" pattern="out"/>
</correlations>
</invoke>
</compensationHandler>
<invoke partnerLink="Seller" portType="SP:Purchasing"
operation="SyncPurchase"
inputVariable="sendPO"
outputVariable="getResponse">
<correlations>
<correlation set="PurchaseOrder" initiate=“yes” pattern="out"/>
</correlations>
</invoke>
</scope>
Exception Handling in BPEL
Servlet EJB
Application Server
Normalized
Message Bus
Binding Framework
JSR 208
Web ... Binding SPI
EDI JCA JMS
Services