‫أكاديمية الحكومة اإللكترونية الفلسطينية‬         The Palestinian eGovernment Academy                       www.egovacadem...
AboutThis tutorial is part of the PalGov project, funded by the TEMPUS IV program of theCommission of the European Communi...
© Copyright NotesEveryone is encouraged to use this material, or part of it, but should properlycite the project (logo and...
Tutorial Map           Intended Learning ObjectivesA: Knowledge and Understanding                                         ...
Session 13: Component based service    development/ WS composition (BPEL).               Session ILOsAfter completing this...
Session Outlines   Introduction   Partners   BPEL: Important features   BPEL for Service Composition   Developing BP ...
Overview                       BPEL4WS      WS-Transaction                                        UDDI                    ...
Introduction• A business process specifies the potential  execution order of operations from [2]:  – A collection of web s...
Introduction, cont.• To enable users to connect different  components even across organizational  boundaries in a platform...
Introduction, cont.• BPEL allows specifying business processes  and how they relate to web services [2].  – Business proce...
General structure of a BPEL for web      service process<process ...>  <partners> ... </partners>       <!-- Web services ...
Session Outlines     Introduction     Partners     BPEL: Important features     BPEL for Service Composition     Deve...
Partners• The partners of business processes involving  web services often interact with.• Partners are connected to a pro...
Partners, cont.• Partners are one of the following [1]:  – Services that the process invokes only.  – Services that invoke...
Automation of Business Processes• For efficient automation of business processes  through IT we need to:  – Provide a stan...
Relation between SOA, web services, ESB, andBPEL               Source, [3]                PalGov © 2011                  16
Web service context• Web services are a distributed architecture:   – The distributed computing paradigm started with DCE ...
BP example             Source, [3]             PalGov © 2011   18
Session Outlines     Introduction     Partners     BPEL: Important features     BPEL for Service Composition     Deve...
BPEL: Important features• Describe the logic of business processes through  composition of services• Compose larger busine...
BPEL: Important features, cont.• Selectively compensate completed activities in  case of failures• Maintain multiple long-...
BPEL: Important features, cont.• Schedule activities based on the execution time  and define their order of execution• Exe...
Session Outlines   Introduction   Partners   BPEL: Important features   BPEL for Service Composition   Developing BP ...
BPEL for Service Composition• Business process automation requires standards• Also, requires a specialized language for  c...
Composition of services in private processes,      Orchestration• A central process (which can be another web  service):  ...
Orchestration                Source, [3]                PalGov © 2011   26
Composition of services in public processes,       Choreography• Each web service involved in the choreography  knows exac...
Choreography               Source, [3]               PalGov © 2011   28
Session Outlines   Introduction   Partners   BPEL: Important features   BPEL for Service Composition   Developing BP ...
Developing BP with BPEL• BPEL uses an XML-based vocabulary that  allows us to specify and describe business  processes.• W...
Partner Links• When we describe a business process in BPEL, we  actually define a new web service that is a  composition o...
BPEL process and its partner links              Source, [3]               PalGov © 2011         32
BPEL Core Concepts• A BPEL process consists of steps “activities”,• Two types: basic and structured activities.• Seven bas...
Basic activities, cont.• Cont.:  3. Generating a response for synchronous     operations, using <reply>  4. Manipulating d...
BPEL structured activities1. Sequence (<sequence>) for defining a set of   activities that will be invoked in an ordered  ...
Session Outlines   Introduction   Partners   BPEL: Important features   BPEL for Service Composition   Developing BP ...
Simple BPEL process example• Select the best insurance offer from several• We first declare the partner links to the BPEL ...
Example, Cont.<?xml version="1.0" encoding="utf-8"?><process name="InsuranceSelectionProcess"  targetNamespace="http://com...
Example, Cont.• The two insurance web services (called insuranceA and  insuranceB):<partnerLinks>      <partnerLink name="...
Example, Cont.• Declare variables for:  – The insurance request (InsuranceRequest),  – Insurance      A       and   B    r...
Example, Cont....   <variables>       <!-- input for BPEL process -->       <variable name="InsuranceRequest"             ...
Example, Cont.• Finally, we specify the process steps:   – First we wait for the initial request message from the     clie...
Example, Cont....  <sequence>  <!-- Receive the initial request from client -->  <receive partnerLink="client"      portTy...
Example, Cont.<!-- Make concurrent invocations to Insurance A and B --><flow>    <!-- Invoke Insurance A web service -->  ...
Example, Cont.<!-- Select the best offer and construct the response -->   <switch>   <case condition = "bpws:getVariableDa...
Example, Cont.     <otherwise>     <!-- Select Insurance B -->       <assign>       <copy>              <from variable="In...
SummaryDuring this module we have explained with examples how to use business process execution language BPEL; the followi...
References1.   Sanjiva Weerawarana, Francisco Curbera, “Business Process with     BPEL4WS: Understanding BPEL4WS”, IBM TJ ...
ThanksMohammed Aldasht   PalGov © 2011   49
Upcoming SlideShare
Loading in …5
×

Pal gov.tutorial3.session13.bpel

347 views
304 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
347
On SlideShare
0
From Embeds
0
Number of Embeds
41
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Pal gov.tutorial3.session13.bpel

  1. 1. ‫أكاديمية الحكومة اإللكترونية الفلسطينية‬ The Palestinian eGovernment Academy www.egovacademy.ps Tutorial III:Process Integration and Service Oriented Architectures Session 13 BPEL Prepared By Mohammed Aldasht PalGov © 2011 1
  2. 2. AboutThis tutorial is part of the PalGov project, funded by the TEMPUS IV program of theCommission of the European Communities, grant agreement 511159-TEMPUS-1-2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.psProject Consortium: Birzeit University, Palestine University of Trento, Italy (Coordinator ) Palestine Polytechnic University, Palestine Vrije Universiteit Brussel, Belgium Palestine Technical University, Palestine Université de Savoie, France Ministry of Telecom and IT, Palestine University of Namur, Belgium Ministry of Interior, Palestine TrueTrust, UK Ministry of Local Government, PalestineCoordinator:Dr. Mustafa JarrarBirzeit University, P.O.Box 14- Birzeit, PalestineTelfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011 2
  3. 3. © Copyright NotesEveryone is encouraged to use this material, or part of it, but should properlycite the project (logo and website), and the author of that part.No part of this tutorial may be reproduced or modified in any form or by anymeans, without prior written permission from the project, who have the fullcopyrights on the material. Attribution-NonCommercial-ShareAlike CC-BY-NC-SAThis license lets others remix, tweak, and build upon your work non-commercially, as long as they credit you and license their new creationsunder the identical terms. PalGov © 2011 3
  4. 4. Tutorial Map Intended Learning ObjectivesA: Knowledge and Understanding Title T Name 3a1: Demonstrate knowledge of the fundamentals of middleware. 3a2: Describe the concept behind web service protocols. Session0: Syllabus and overview 0 Aldasht 3a3: Explain the concept of service oriented architecture. Sesson1: Introduction to SOA 2 Aldasht 3a4: Explain the concept of enterprise service bus. Session2: XML namespaces & XML schema 2 Aldasht 3a5: Understanding WSDL service interfaces in UDDI. Session 3: Xpath & Xquery 4 RomiB: Intellectual Skills Session4: REST web services 3 M. Melhem 3b1: Design, develop, and deploy applications based on Service Session5: Lab2: Practice on REST 3 M. Melhem Oriented Architecture (SOA). Session 6: SOAP 2 Aldasht 3b2: use Business Process Execution Language (BPEL). Session 7: WSDL 3 Aldasht 3b3: using WSDL to describe web services. Session8: Lab 3: WSDL practice 3 AldashtC: Professional and Practical Skills Session9: ESB 4 Aldasht 3c1: setup, Invoke, and deploy web services using integrated Session10: Lab4: Practice on ESB 4 Aldasht development environment. Session11: integration patterns 4 M. Melhem 3c2: construct and use REST and SOAP messages for web services communication. Session12: Lab5: integration patterns 4 M. MelhemD: General and Transferable Skills Session13: BPEL 3 Aldasht d1: Working with team. Session14: Lab6: Practice on BPEL 2 Aldasht d2: Presenting and defending ideas. Session15: UDDI 3 Aldasht d3: Use of creativity and innovation in problem solving. d4: Develop communication skills and logical reasoning abilities.
  5. 5. Session 13: Component based service development/ WS composition (BPEL). Session ILOsAfter completing this module students will be able to use business process execution language BPEL. PalGov © 2011 5
  6. 6. Session Outlines Introduction Partners BPEL: Important features BPEL for Service Composition Developing BP with BPEL BPEL process example PalGov © 2011 6
  7. 7. Overview BPEL4WS WS-Transaction UDDI WSDL SOAP Relationship among standards, Source, [2] PalGov © 2011 7
  8. 8. Introduction• A business process specifies the potential execution order of operations from [2]: – A collection of web services – The data shared between these web services – Other issues involving which partners are involved, how multiple services and organizations participate• This especially allows: – Specifying long-running transactions between web services. – Increasing consistency and reliability for web services applications. PalGov © 2011 8
  9. 9. Introduction, cont.• To enable users to connect different components even across organizational boundaries in a platform- and language- independent manner, standards used: – WSDL to describe the Web service. – UDDI to advertise and organize Web services. – SOAP to communicate with Web service. PalGov © 2011 9
  10. 10. Introduction, cont.• BPEL allows specifying business processes and how they relate to web services [2]. – Business processes specified in BPEL are fully executable and portable. – A BPEL business process interoperates with the web services of its partners. – BPEL supports the specification of business protocols between partners. PalGov © 2011 10
  11. 11. General structure of a BPEL for web service process<process ...> <partners> ... </partners> <!-- Web services the process interacts with --> <containers> ... </containers> <!– Data used by the process --> <correlationSets> ... </correlationSets> <!– Used to support asynchronous interactions --> <faultHandlers> ... </faultHandlers> <!–Alternate execution path to deal with faulty conditions --> <compensationHandlers> ... </compensationHandlers> <!–Code to execute when “undoing” an action --> (activities)* <!– What the process actually does --></process> PalGov © 2011 11
  12. 12. Session Outlines  Introduction  Partners  BPEL: Important features  BPEL for Service Composition  Developing BP with BPEL  BPEL process example PalGov © 2011 12
  13. 13. Partners• The partners of business processes involving web services often interact with.• Partners are connected to a process in a bilateral manner partner links [2].• Process can use the partner link to speak to a specific web service. PalGov © 2011 13
  14. 14. Partners, cont.• Partners are one of the following [1]: – Services that the process invokes only. – Services that invoke the process only. – Or services that the process invokes and invoke the process PalGov © 2011 14
  15. 15. Automation of Business Processes• For efficient automation of business processes through IT we need to: – Provide a standardized way to expose and access the functionality of applications as services. – Provide an enterprise bus infrastructure for communication and management of services. – Provide integration architecture between the various services and existing and newly developed applications used in business processes. – Provide a specialized language for composition of applications into business processes. PalGov © 2011 15
  16. 16. Relation between SOA, web services, ESB, andBPEL Source, [3] PalGov © 2011 16
  17. 17. Web service context• Web services are a distributed architecture: – The distributed computing paradigm started with DCE (Distributed Computing Environment) RPC (Remote Procedure Call), and messaging systems. – Then the following emerged, distributed objects and ORBs (Object Request Brokers), such as CORBA (Common Object Request Broker Architecture), DCOM (Distributed Component Object Model), and RMI (Remote Method Invocation). – Based on them component models, such as EJB (Enterprise Java Beans), COM+ (Component Object Model), .NET Enterprise Services, and CCM (CORBA Component Model) have been developed. PalGov © 2011 17
  18. 18. BP example Source, [3] PalGov © 2011 18
  19. 19. Session Outlines  Introduction  Partners  BPEL: Important features  BPEL for Service Composition  Developing BP with BPEL  BPEL process example PalGov © 2011 19
  20. 20. BPEL: Important features• Describe the logic of business processes through composition of services• Compose larger business processes out of smaller processes and services• Handle synchronous and asynchronous (often long-running) operation invocations on services, and manage callbacks that occur at later times• Invoke service operations in sequence or parallel PalGov © 2011 20
  21. 21. BPEL: Important features, cont.• Selectively compensate completed activities in case of failures• Maintain multiple long-running transactional activities, which are also interruptible• Resume interrupted or failed activities to minimize work to be redone• Route incoming messages to the appropriate processes and activities PalGov © 2011 21
  22. 22. BPEL: Important features, cont.• Schedule activities based on the execution time and define their order of execution• Execute activities in parallel and define how parallel flows merge based on synchronization conditions PalGov © 2011 22
  23. 23. Session Outlines Introduction Partners BPEL: Important features BPEL for Service Composition Developing BP with BPEL BPEL process example PalGov © 2011 23
  24. 24. BPEL for Service Composition• Business process automation requires standards• Also, requires a specialized language for composing services into business processes• Composition of business processes should support many process instances, long-running processes, etc.• The main goal of BPEL is to standardize the process of automation between web services. PalGov © 2011 24
  25. 25. Composition of services in private processes, Orchestration• A central process (which can be another web service): – Takes control over the involved web services – Coordinates the execution of different operations on the web services involved in the operation. PalGov © 2011 25
  26. 26. Orchestration Source, [3] PalGov © 2011 26
  27. 27. Composition of services in public processes, Choreography• Each web service involved in the choreography knows exactly when to execute its operations and whom to interact with.• Choreography is a collaborative effort focused on exchange of messages in public business processes PalGov © 2011 27
  28. 28. Choreography Source, [3] PalGov © 2011 28
  29. 29. Session Outlines Introduction Partners BPEL: Important features BPEL for Service Composition Developing BP with BPEL BPEL process example PalGov © 2011 29
  30. 30. Developing BP with BPEL• BPEL uses an XML-based vocabulary that allows us to specify and describe business processes.• With BPEL, we can describe business processes in two distinct ways: – Executable business processes specify the exact details of business processes and can be executed by a BPEL engine. – Abstract business processes specify only the public message exchange between parties, without specific details of process flows. PalGov © 2011 30
  31. 31. Partner Links• When we describe a business process in BPEL, we actually define a new web service that is a composition of existing services.• Developing BPEL processes requires a good understanding of WSDL and other related technologies.• BPEL introduces WSDL extensions, which enable us to accurately specify relations (partner links) between several web services in the business process. PalGov © 2011 31
  32. 32. BPEL process and its partner links Source, [3] PalGov © 2011 32
  33. 33. BPEL Core Concepts• A BPEL process consists of steps “activities”,• Two types: basic and structured activities.• Seven basic activities: 1. Invoking other web services, using <invoke> 2. Waiting for the client to invoke the business process through sending a message, using <receive> (receiving a request) PalGov © 2011 33
  34. 34. Basic activities, cont.• Cont.: 3. Generating a response for synchronous operations, using <reply> 4. Manipulating data variables, using <assign> 5. Indicating faults and exceptions, using <throw> 6. Waiting for some time, using <wait> 7. Terminating the entire process, using <terminate> PalGov © 2011 34
  35. 35. BPEL structured activities1. Sequence (<sequence>) for defining a set of activities that will be invoked in an ordered sequence2. Flow (<flow>) for defining a set of activities that will be invoked in parallel3. Case-switch construct (<switch>) for implementing branches4. While (<while>) for defining loops5. The ability to select one of a number of alternative paths, using <pick> PalGov © 2011 35
  36. 36. Session Outlines Introduction Partners BPEL: Important features BPEL for Service Composition Developing BP with BPEL BPEL process example PalGov © 2011 36
  37. 37. Simple BPEL process example• Select the best insurance offer from several• We first declare the partner links to the BPEL process client (called client) and two insurance web services (called insuranceA and insuranceB): PalGov © 2011 37
  38. 38. Example, Cont.<?xml version="1.0" encoding="utf-8"?><process name="InsuranceSelectionProcess" targetNamespace="http://companyx.com/bpe l/example/" xmlns="http://schemas.xmlsoap.org/ws/200 3/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/w s/2003/03/business-process/" xmlns:ins="http://companyx.com/bpel/insu rance/" xmlns:com="http://companyx.com/bpel/comp any/" > PalGov © 2011 38
  39. 39. Example, Cont.• The two insurance web services (called insuranceA and insuranceB):<partnerLinks> <partnerLink name="client" partnerLinkType="com:selectionLT" myRole="insuranceSelectionService"/> <partnerLink name="insuranceA" partnerLinkType="ins:insuranceLT“ myRole="insuranceRequester" partnerRole="insuranceService"/> <partnerLink name="insuranceB" partnerLinkType="ins:insuranceLT" myRole="insuranceRequester" partnerRole="insuranceService"/> </partnerLinks> PalGov © 2011 39
  40. 40. Example, Cont.• Declare variables for: – The insurance request (InsuranceRequest), – Insurance A and B responses (InsuranceAResponse, InsuranceBResponse), – The final selection (InsuranceSelectionResponse) PalGov © 2011 40
  41. 41. Example, Cont.... <variables> <!-- input for BPEL process --> <variable name="InsuranceRequest" messageType="ins:InsuranceRequestMessage"/> <!-- output from insurance A --> <variable name="InsuranceAResponse" messageType="ins:InsuranceResponseMessage"/> <!-- output from insurance B --> <variable name="InsuranceBResponse" messageType="ins:InsuranceResponseMessage"/> <!-- output from BPEL process --> <variable name="InsuranceSelectionResponse" messageType="ins:InsuranceResponseMessage"/> </variables>... PalGov © 2011 41
  42. 42. Example, Cont.• Finally, we specify the process steps: – First we wait for the initial request message from the client (<receive>) – Then we invoke both insurance web services (<invoke>) in parallel using the <flow> activity. – The insurance web services return the insurance premium. – Then we select the lower amount (<switch>/<case>) and return the result to the client (the caller of the BPEL process) using the <reply> activity. PalGov © 2011 42
  43. 43. Example, Cont.... <sequence> <!-- Receive the initial request from client --> <receive partnerLink="client" portType="com:InsuranceSelectionPT" operation="SelectInsurance" variable="InsuranceRequest" createInstance="yes" /> PalGov © 2011 43
  44. 44. Example, Cont.<!-- Make concurrent invocations to Insurance A and B --><flow> <!-- Invoke Insurance A web service --> <invoke partnerLink="insuranceA" portType="ins:ComputeInsurancePremiumPT" operation="ComputeInsurancePremium" inputVariable="InsuranceRequest" outputVariable="InsuranceAResponse" /> <!-- Invoke Insurance B web service --> <invoke partnerLink="insuranceB" portType="ins:ComputeInsurancePremiumPT" operation="ComputeInsurancePremium" inputVariable="InsuranceRequest" outputVariable="InsuranceBResponse" /></flow> PalGov © 2011 44
  45. 45. Example, Cont.<!-- Select the best offer and construct the response --> <switch> <case condition = "bpws:getVariableData (InsuranceAResponse, confirmationData, „/confirmationData/ins:Amount) &lt;= bpws: getVariableData (InsuranceBResponse, confirmationData, „/confirmationData/ins:Amount)"> <!-- Select Insurance A --> <assign> <copy> <from variable="InsuranceAResponse" /> <to variable="InsuranceSelectionResponse" /> </copy> </assign> </case> PalGov © 2011 45
  46. 46. Example, Cont. <otherwise> <!-- Select Insurance B --> <assign> <copy> <from variable="InsuranceBResponse" /> <to variable="InsuranceSelectionResponse" /> </copy> </assign> </otherwise> </switch> <!-- Send a response to the client --> <reply partnerLink="client" portType="com:InsuranceSelectionPT" operation="SelectInsurance" variable="InsuranceSelectionResponse"/> </sequence></process> PalGov © 2011 46
  47. 47. SummaryDuring this module we have explained with examples how to use business process execution language BPEL; the following subject have been covered: 1. Partners 2. BPEL: Important features 3. BPEL for Service Composition 4. Developing BP with BPEL 5. BPEL process exampleNext module will cover the UDDI PalGov © 2011 47
  48. 48. References1. Sanjiva Weerawarana, Francisco Curbera, “Business Process with BPEL4WS: Understanding BPEL4WS”, IBM TJ Watson Research Center, 20022. Frank Leymann, Dieter Roller, “Business processes in a web services world”, IBM Software Group, 20023. Matjaz B. Juric, Benny Mathew and Poornachandra Sarang, Business Process Execution Language for Web Services , Second Edition, Packt Publishing , 2006. PalGov © 2011 48
  49. 49. ThanksMohammed Aldasht PalGov © 2011 49

×