Oracle

1,859 views

Published on

Published in: Business, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,859
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
44
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Oracle

  1. 2. BPEL: Building Standards-Based Business Processes with Web Services Session id: 40024
  2. 3. Web Services Meet Business Processes Web Service 1 Web Service 2 Web Service 3 Web Service 4 Web Service 5 Web Service n
  3. 4. Example Problem Space Client PO Service Credit Service Inventory Service Consolidate Results Purchase Order Credit Check Reserve Inventory Credit Response Inventory Response Invoice
  4. 5. Business Process Challenges <ul><li>Coordinate asynchronous communication between services </li></ul><ul><li>Correlate message exchanges between parties </li></ul><ul><li>Implement parallel processing of activities </li></ul><ul><li>. . . </li></ul><ul><li>Manipulate/transform data between partner interactions </li></ul><ul><li>Support for long running business transactions and activities </li></ul><ul><li>Provide consistent exception handling </li></ul><ul><li>. . . </li></ul>
  5. 6. Recent History of Business Process Standards 2000/05 XLang (Microsoft) 2001/03 BPML (Intallio et al) 2001/05 WSFL (IBM) 2001/06 BPSS (ebXML) 2002/03 BPEL4WS 1.0 (IBM, Microsoft) BPEL4WS 1.1 (OASIS) 2002/06 2003/01 WS-Choreography (W3C) 2003/04 WSCI (Sun et al) WSCL (HP) 2002/08
  6. 7. Orchestration vs Choreography <ul><li>Orchestration </li></ul><ul><ul><li>An executable business process describing a flow from the perspective and under control of a single endpoint (commonly: Workflow) </li></ul></ul><ul><li>Choreography </li></ul><ul><ul><li>The observable public exchange of messages, rules of interaction and agreements between two or more business process endpoints </li></ul></ul>
  7. 8. Sample Business Process: Purchase Order Sample Purchase Order Purchase Order Request Purchase Order Acknowledgement Purchase Order Response Business “A” Business “ B”
  8. 9. From a Choreography Perspective PO Request PO Acknowledgement PO Response Choreography – The observable public exchange of messages Public Process Business A Business B Send PO Receive PO Ack Receive PO Response Receive PO Send PO Ack Send PO Response
  9. 10. From an Orchestration Perspective Send PO Receive PO Ack Receive PO Response Transform Transform From ERP To ERP PO Request PO Acknowledgement PO Response Orchestration – A private executable business process Private Process Business A BPEL Workflow
  10. 11. Orchestration and Choreography Together Send PO Receive PO Ack Receive PO Response Transform Transform Business A BPEL Workflow PO Request PO Acknowledgement PO Response Generate BPEL Template Generate BPEL Template Receive PO Send PO Ack Receive PO Response Transform Transform Business B BPEL Workflow Two BPEL workflow templates reflecting a business agreement Business B Business Analyst Tool Business A
  11. 12. Business Process Execution Language for Web Services <ul><li>Version 1.0 released by IBM, Microsoft and BEA in August 2002 </li></ul><ul><ul><li>Accompanied by WS-Coordination, WS-Transaction which remain unsubmitted to standards bodies </li></ul></ul><ul><li>Version 1.1 submitted to OASIS April 2003 </li></ul><ul><li>XML language for describing business processes based on Web services </li></ul><ul><ul><li>Convergence of XLANG (Microsoft) and WSFL (IBM) </li></ul></ul><ul><li>Unprecendented industry consensus </li></ul><ul><ul><li>IBM, Microsoft, Oracle, Sun, BEA, SAP, Siebel … </li></ul></ul>
  12. 13. Value Proposition <ul><li>Portable business processes </li></ul><ul><ul><li>Built on top of an interoperable infrastructure of Web services </li></ul></ul><ul><li>Industry wide language for business processes </li></ul><ul><ul><li>Common skill set and language for developers </li></ul></ul><ul><li>Choice of process engines </li></ul><ul><ul><li>Standards lead to competitive offerings </li></ul></ul>
  13. 14. Standards Building Blocks of BPEL Description HTTP,IIOP, JMS, SMTP Transport XML Message SOAP WSDL UDDI Discovery Transactions Coordination WS-Security WS-Reliability Quality of Service Business Processes Context Description Management Orchestration - BPEL4WS Choreography - CDL4WS
  14. 15. BPEL Depends on WSDL and WSDL Extensions Service Implementation Definition Service Interface Definition Service Port Binding Port types define Operations Message Type
  15. 16. 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>
  16. 17. BPEL Activities <ul><li>Primitive Activities </li></ul><ul><li><invoke> </li></ul><ul><li><receive> </li></ul><ul><li><assign> </li></ul><ul><li><reply> </li></ul><ul><li><throw> </li></ul><ul><li><terminate> </li></ul><ul><li><wait> </li></ul><ul><li>Structured Activities </li></ul><ul><li><sequence> </li></ul><ul><li><switch> </li></ul><ul><li><pick> </li></ul><ul><li><flow> </li></ul><ul><li><link> </li></ul><ul><li><while> </li></ul><ul><li><scope> </li></ul>
  17. 18. Partners <ul><li>Declare the Web services and roles used by the process </li></ul><ul><li>Tied to WSDL of the process itself and the participating Web services by service link types </li></ul>Credit Service Partner 2 Inventory Service Partner 3 Partner 1 (the process) Purchase Service
  18. 19. Partners in BPEL <partnerLinks> <partnerLink name=“customer&quot; serviceLinkType=“lns:purchasePLT” myRole=“purchaseService”/> <partnerLink name= “ inventoryChecker ” serviceLinkType= “ lns:inventoryPLT ” myRole=“inventoryRequestor” partnerRole=“inventoryService”/> <partnerLink name=“creditChecker” serviceLinkType=“lns:creditPLT” myRole=“creditRequestor” partnerRole=“creditService”/> </partnerLinks> <plt:partnerLinkType name= “ purchasePLT”> <plt:role name= “ purchaseService”> <plt:portType name= “ tns:purchasePT”/> </plt:role> </plt:partnerLinkType> Purchase Process WSDL: BPEL: <portType name= “ purchasePT”> < operation name = &quot; sendPurchase &quot; > </operation> </portType> Purchase Process PortType:
  19. 20. Variables <ul><li>Messages sent and received from partners </li></ul><ul><ul><li>Persisted for long running interactions </li></ul></ul><ul><ul><li>Defined in WSDL types and messages </li></ul></ul>Customer Service Process <variable> <activity> <activity> Persist Persist/ Retrieve Customer Service Persist/ Retrieve Persist/ Retrieve <variable> <A> <B>
  20. 21. Variables in BPEL <variables> <variable name=“PO” messageType=“lns:POMessage”/> <variable name=“Invoice” messageType=“lns:InvMessage”/> <variable name=“POFault” messageType=“lns:orderFaultType”/> </variables> <message name=“POMessage”> <part name=“customerInfo” type=“sns:customerInfo”/> <part name=“purchaseOrder” type=“sns:purchaseOrder”/> </message> <message name=&quot;InvMessage&quot;> <part name=“IVC” type=“sns:Invoice”/> </message> <message name=“orderFaultType”> <part name=“problemInfo” type=“xsd:string”/> </message> Purchase Process WSDL: BPEL:
  21. 22. How is Data Manipulation Done? <ul><li>Using <assign> and <copy> , data can be copied and manipulated between variables </li></ul><ul><li><copy> supports XPath queries to sub-select data </li></ul><assign> <copy> <from variable=&quot;PO&quot; part=&quot;customerInfo&quot;/> <to variable=“creditRequest” part=&quot;customerInfo&quot;/> </copy> </assign>
  22. 23. Simple Activities <ul><li>Receive </li></ul><ul><ul><li>Wait for a partner inbound message </li></ul></ul><ul><ul><li>Can be the instantiator of the business process </li></ul></ul><ul><li>Reply </li></ul><ul><ul><li>Synchronous response to a receive activity </li></ul></ul><ul><ul><li>Response to the inbound receive from a partner </li></ul></ul><ul><li>Invoke </li></ul><ul><ul><li>Issue a request synchronously *or* asynchronously </li></ul></ul><ul><li>Pick </li></ul><ul><ul><li>Specify an inbound set of messages </li></ul></ul><ul><ul><li>Can be the instantiator of the business process </li></ul></ul><ul><ul><li>Activity completes when one of the messages arrives </li></ul></ul>
  23. 24. Simple Activities Combined with Structured Activities Invoke <InventoryService> Invoke <CreditService> Reply <Invoice> Receive <PO> <sequence> <flow> </sequence>
  24. 25. Sample Activities in BPEL <sequence> <receive partnerLink=“customer” portType=“lns:purchaseOrderPT&quot; operation=“sendPurchaseOrder” variable=“PO” createInstance=&quot;yes&quot; /> <flow> <invoke partnerLink=“inventoryChecker” portType=“lns:inventoryPT” operation=&quot;checkINV&quot; inputVariable=&quot;inventoryRequest&quot; outputVariable=&quot;inventoryResponse&quot; /> <invoke partnerLink=&quot;creditChecker&quot; portType=“lns:creditPT&quot; operation=&quot;checkCRED&quot; inputVariable=&quot;creditRequest&quot; outputVariable=&quot;creditResponse&quot; /> </flow> ... <reply partnerLink=“customer” portType=“lns:purchaseOrderPT” operation=“sendPurchaseOrder” variable=“invoice&quot;/> </sequence>
  25. 26. Links – Control Flow <flow> <links> <link name=&quot;XtoY&quot;/> <link name=&quot;CtoD&quot;/> </links> <sequence name=&quot;X&quot;> <source linkName=&quot;XtoY&quot;/> <invoke name=&quot;A&quot; .../> <invoke name=&quot;B&quot; .../> </sequence> <sequence name&quot;Y&quot;> <target linkName=&quot;XtoY&quot;/> <receive name=&quot;C&quot;/> <source linkName=&quot;CtoD&quot;/> </receive> <invoke name=&quot;E&quot; .../> </sequence> <invoke partnerLink=&quot;D&quot;> <target linkName=&quot;CtoD&quot;/> </invoke> </flow> <flow> </flow> <Y> <X> <link CtoD> <link XtoY> <C> <E> <A> <B> <D>
  26. 27. Correlation Customer <ul><li>SendPurchase </li></ul><ul><li>ProcessPurchaseResponse </li></ul>PO Correlation: < PO_CustId = 10> <PO_OrdId = 100> POResponse Correlations: < PO_CustId = 10> <PO_OrdId = 100> <Inv_VendId = 20> <Inv_InvId = 200> Seller <ul><li>AsynchPurchase </li></ul><ul><li>AsynchPurchaseResponse </li></ul>initiate=yes initiate=yes pattern=out initiate=no pattern=out initiate=yes initiate=yes initiate=no
  27. 28. Correlations in BPEL <correlationSets> <correlationSet name= &quot; POCorr &quot; properties=&quot;cor:custId cor:ordId&quot;/> <correlationSet name= &quot; InvoiceCorr &quot; properties= &quot; cor:vendId cor:invId &quot; /> </correlationSets> ... <receive partnerLink=“Customer” portType= &quot; SP:PurchaseOrderPT &quot; operation= &quot; AsynchPurchase &quot; variable= &quot; PO &quot; > <correlations> <correlation set= &quot; POCorr &quot; initiate= &quot; yes &quot; > </correlations> </receive> ... <invoke partnerLink=“Customer” portType= &quot; SP:CustomerPT &quot; operation= “ ProcessPurchaseResponse &quot; inputVariable= &quot; POResponse &quot; > <correlations> <correlation set= &quot; POCorr &quot; initiate= &quot; no &quot; pattern= &quot; out &quot; > <correlation set= &quot; InvoiceCorr &quot; initiate= &quot; yes &quot; pattern= &quot; out &quot; > </correlations> </invoke> ...
  28. 29. Scopes in BPEL <ul><li>Provide a shared context for subset of activities </li></ul><ul><li>Can contain </li></ul><ul><ul><li>fault handlers </li></ul></ul><ul><ul><li>event handlers, </li></ul></ul><ul><ul><li>compensation handler variables </li></ul></ul><ul><ul><li>correlation sets </li></ul></ul><ul><li>Can serialize concurrent access to variables </li></ul><scope variableAccessSerializable=&quot;yes|no“ ...> <variables> </variables> <correlationSets>? ... </correlationSets> <faultHandlers> </faultHandlers> <compensationHandler>? ... </compensationHandler> <eventHandlers> </eventHandlers> ( activities)* </scope>
  29. 30. Long Running Transactions and Compensation <scope> </scope> <ul><li>ReserveInventory </li></ul><ul><li>CancelReserveInv </li></ul>InventoryService <ul><li>CheckCredit </li></ul><ul><li>ChargeHoldFee </li></ul><ul><li>CancelHoldFee </li></ul>CreditService Undo Reserve Inventory Undo Charge Hold Fee
  30. 31. Compensation Handlers in BPEL <scope> <compensationHandler> <invoke partnerLink= &quot; Seller &quot; portType= &quot; SP:Purchasing &quot; operation= &quot; CancelPurchase &quot; inputVariable=&quot;getResponse&quot; outputVariable=&quot;getConfirmation&quot;> <correlations> <correlation set=&quot;PurchaseOrder&quot; pattern=&quot;out&quot;/> </correlations> </invoke> </compensationHandler> <invoke partnerLink=&quot;Seller&quot; portType=&quot;SP:Purchasing&quot; operation=&quot;SyncPurchase&quot; inputVariable=&quot;sendPO&quot; outputVariable=&quot;getResponse&quot;> <correlations> <correlation set=&quot;PurchaseOrder&quot; initiate=“yes” pattern=&quot;out&quot;/> </correlations> </invoke> </scope>
  31. 32. Exception Handling in BPEL <ul><li><faultHandlers> catch exception </li></ul><ul><ul><li>Based on WSDL port defining fault </li></ul></ul><ul><li><faultHandlers> can perform activities upon invocation </li></ul><faultHandlers> <catch faultName=&quot;lns:cannotCompleteOrder&quot; faultVariable=&quot;POFault&quot;> <reply partnerLink=&quot;customer&quot; portType=&quot;lns:purchaseOrderPT&quot; operation=&quot;sendPurchaseOrder&quot; variable=&quot;POFault&quot; faultName=&quot;cannotCompleteOrder&quot;/> </catch> </faultHandlers>
  32. 33. Just Show Me How to Do it! . . . <ul><li>Compile </li></ul><ul><li>Package </li></ul><ul><li>Deploy </li></ul>Partner WSDL 1 Process WSDL Partner WSDL n BPEL Scenario <process> <partners> <variables> <sequence> <flow> </sequence> </process> Application Server BPEL Runtime Compiled BPEL Scenario
  33. 34. Tooling Requirements <ul><li>IDE – build your Web services </li></ul><ul><li>WSDL authoring – model your interfaces </li></ul><ul><li>Schema authoring – model your messages </li></ul><ul><li>Process modeling – model your orchestration </li></ul><ul><li>Packaging and deployment </li></ul><ul><li>Debugging </li></ul><ul><li>Monitoring </li></ul><ul><li>Analyzing </li></ul>
  34. 35. What Happened to Java? <ul><li>JSR 207 - Process Definition Language for Java </li></ul><ul><li>Make business processes natural for Java programmers </li></ul>Application Server Servlet EJB Based on JSR 207 Session at JavaOne 2003 Messaging Transactions Pooling Naming Security Process Definition for Java
  35. 36. What Happened to J2EE? <ul><li>JSR 208 – Java Business Integration </li></ul><ul><li>Make business processes a first class citizen in J2EE containers </li></ul>Based on JSR 208 Session at JavaOne 2003 . . . Routing Engine Transform Engine BPEL Engine Normalized Message Bus JSR 208 Binding SPI . . . Binding Framework JSR 208 Machine SPI EDI JCA Web Services JMS
  36. 37. Oracle’s Strategy <ul><li>Oracle Application Server Containers for J2EE 10 g </li></ul><ul><ul><li>BPEL runtime </li></ul></ul><ul><li>Oracle JDeveloper 10 g </li></ul><ul><ul><li>BPEL design time </li></ul></ul><ul><li>Oracle Application Server ProcessConnect 10 g </li></ul><ul><ul><li>Web service, B2B and EAI integration </li></ul></ul>
  37. 38. Remember BPEL Does Not Solve “World Hunger” <ul><li>No data transformation </li></ul><ul><li>No data translation (EDI, binary formats …) </li></ul><ul><li>No human workflow </li></ul><ul><li>No trading partner agreements </li></ul><ul><li>Silent on existing business protocols (ebXML, RosettaNet …) </li></ul><ul><li>Silent on non Web service interactions (e.g. java to java) </li></ul><ul><li>. . . </li></ul>
  38. 39. But Remember: People Are Trying to Solve “World Hunger” <ul><li>W3C: WS-Choreography </li></ul><ul><li>Spec: WS-Transaction </li></ul><ul><li>Spec: WS-Coordination </li></ul><ul><li>Spec: WS-Composite Application Framework </li></ul><ul><li>OASIS: WS-Reliability </li></ul><ul><li>Spec: ReliableMessaging </li></ul><ul><li>Spec: WS-Addressing </li></ul><ul><li>OASIS: WS-Security </li></ul><ul><li>… </li></ul>
  39. 40. Parting Thoughts <ul><li>Business process portability? </li></ul><ul><ul><li>Java/J2EE is portable across application servers </li></ul></ul><ul><ul><li>BPEL is portable independent of Java </li></ul></ul><ul><li>Programming language in XML? </li></ul><ul><ul><li>Vendors, big and small, are busy building design times and modelers… </li></ul></ul><ul><li>Is BPEL in 2003/2004 J2EE in 1998? </li></ul><ul><ul><li>Much missing but compelling foundation </li></ul></ul>

×