【正文】
服務(wù)科學(xué)與工程 第八章 BPEL 1 We are here! Services atomic and posite Operational Systems Service Components Consumers Business Process Composition。 choreography。 business state machines Packaged Application Custom Application OO Application Channel B2B 2 山東大學(xué)齊魯軟件學(xué)院 主要內(nèi)容 ? BPEL簡介 ? BPEL的基本結(jié)構(gòu)和主要元素 ? BPEL基本活動 ? BPEL結(jié)構(gòu)化活動 ? BPEL實(shí)例 3 山東大學(xué)齊魯軟件學(xué)院 BPEL簡介 4 BPEL: Business Process Execution Language 業(yè)務(wù)流程執(zhí)行語言 Building StandardsBased Business Processes with Web Services 5 業(yè)務(wù)流程 ? 按業(yè)務(wù)流程之間的協(xié)作方式可以分為單工作流模式和多工作流模式 。 ? 單工作流模式 把一組相關(guān)的服務(wù)按一定順序和條件組合執(zhí)行,完成某項(xiàng)業(yè)務(wù),流程執(zhí)行過程中涉及的服務(wù)不屬于其他業(yè)務(wù)流程 。 ? 多工作流模式 是兩個或兩個以上的工作流程并行執(zhí)行并進(jìn)行交互的業(yè)務(wù)流程模式,多工作流模式側(cè)重于業(yè)務(wù)流程之間的交互。 單工作流模式 嵌套子流程模式 鏈型流程模式 P ro c e ss AA 2A 1A 4A 3 6 山東大學(xué)齊魯軟件學(xué)院 Business Processes Flow ? Business processes are a set of activities, supported by services, that support a particular business activity. ? Business processes are business services built using other business services. 7 山東大學(xué)齊魯軟件學(xué)院 BPEL ? BPEL4WS是專為整合 Web Services而制定的一項(xiàng)規(guī)范標(biāo)準(zhǔn)。 ? BPEL描述流程 –可執(zhí)行工作流 —描述業(yè)務(wù)交互中參與者的實(shí)際行為; –抽象流程 —描述各方參與者對外可見的消息交換。 ? BPEL的作用是將一組現(xiàn)有的服務(wù)組合起來,從而定義一個新的 Web服務(wù)。因此, BPEL基本上是一種實(shí)現(xiàn)此種組合的語言。組合服務(wù)的接口也被描述為 WSDL portType的集合。 8 山東大學(xué)齊魯軟件學(xué)院 BPEL BPEL Proce ssInJav aInO utEJBInO utMes sag eInO utOthe rInO utO ut 9 山東大學(xué)齊魯軟件學(xué)院 What BPEL does … ? BPEL binds services together to form larger plex business services ? Control Flow (branch, loop, parallel) ? Asynchronous correlation ? Transaction support, Units of Work ? Compensation 10 山東大學(xué)齊魯軟件學(xué)院 Web Services Meet Business Processes Web Service 1 Web Service 2 Web Service 3 Web Service 4 Web Service 5 Web Service n 11 山東大學(xué)齊魯軟件學(xué)院 Example Problem Space Client PO Service Credit Service Inventory Service Purchase Order Invoice Consolidate Results 12 山東大學(xué)齊魯軟件學(xué)院 Business Process Challenges ? Coordinate asynchronous munication between services ? Correlate message exchanges between parties ? Implement parallel processing of activities ? . . . ? Manipulate/transform data between partner interactions ? Support for long running business transactions and activities ? Provide consistent exception handling ? . . . 13 山東大學(xué)齊魯軟件學(xué)院 Orchestration(管弦樂編曲 ) vs Choreography(舞蹈編排 ) ? 使用 Orchestration, 需要一個總控過程來控制涉及到的 Web服務(wù),并協(xié)調(diào) Web服務(wù)不同操作的執(zhí)行。所涉及到的 Web服務(wù)并不知道(也不必知道)它們是組合過程的一部分。只有中央的總控過程知道它們?nèi)绾谓M合和協(xié)調(diào) ? Choreography并不依賴中央的總控協(xié)調(diào)過程。相反,每個涉及其中的 Web服務(wù)都知道何時執(zhí)行自己的操作,和誰交互。所有的Choreography參與者都需要知道業(yè)務(wù)流程,要執(zhí)行的操作,要交互的消息,和交換消息的時機(jī) 14 山東大學(xué)齊魯軟件學(xué)院 Orchestration(管弦樂編曲 ) vs Choreography(舞蹈編排 ) ?從組合 Web服務(wù)來執(zhí)行業(yè)務(wù)流程的角度來看, Orchestration比 Choreography更靈活: 我們知道誰負(fù)責(zé)執(zhí)行整個業(yè)務(wù)流程。 即使 Web服務(wù)并不知道它們是業(yè)務(wù)流程的一部分,仍然可以把它們組合起來。 當(dāng)錯誤發(fā)生時,我們可以提供一個備選的 Scenario ? BPEL遵循 Orchestration范式 15 山東大學(xué)齊魯軟件學(xué)院 Sample Business Process: Purchase Order Sample Purchase Order Purchase Order Request Purchase Order Acknowledgement Purchase Order Response Business “A” Business “B” 16 山東大學(xué)齊魯軟件學(xué)院 From a Choreography Perspective PO Request Send PO Receive PO Ack Receive PO Response Receive PO Send PO Ack Send PO Response PO Acknowledgement PO Response Choreography – The observable public exchange of messages Public Process Business A Business B 17 山東大學(xué)齊魯軟件學(xué)院 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 18 山東大學(xué)齊魯軟件學(xué)院 Orchestration and Choreography Together Business B Business Analyst Tool Business A 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 19 山東大學(xué)齊魯軟件學(xué)院 Recent History of Business Process Standards 2023/05 XLang (Microsoft) 2023/03 BPML (Intallio et al) 2023/05 WSFL (IBM) 2023/06 BPSS (ebXML) 2023/03 BPEL4WS (IBM, Microsoft) BPEL4WS (OASIS) 2023/06 2023/01 WSChoreography (W3C) 2023/04 WSCI (Sun et al) WSCL (HP) 2023/08 20 山東大學(xué)齊魯軟件學(xué)院 Standards Building Blocks of BPEL Description HTTP,IIOP, JMS, SMTP Transport XML Message SOAP WSDL UDDI Discovery Transactions Coordination WSSecurity WSReliability Quality of Service Orchestration BPEL4WS Business Processes Context Description Management Choreography CDL4WS 21 山東大學(xué)齊魯軟件學(xué)院 BPEL Depends on WSDL and WSDL Extensions Service Implementation Definition Service Interface Definition Service Port Binding Port types define Operatio