Professional Documents
Culture Documents
Objective
Understanding what is orchestration of process.
BPEL is a XML-based language used to define & orchestrate business processes exposed as Web Services
Why BPEL? Developing the web services and exposing the functionality is not sufficient. We also need a way to orchestrate this functionality in the right order. Example: Concert ticket purchase Web service has 3 operations, which need to be performed in the following order
1. Getting a price quote
2.
3.
Purchase a ticket
Confirmation and cancellation
Here Business Process Needs to orchestrate the 3 processes in right order inorder to provide a single overall functionality of purchasing a ticket
Co-ordinate asynchronous communication between services Implement parallel processing of activities Implement compensation logic (Undo operations) Manipulate/transform data between partner interactions Support for long running business transactions and activities Handle exception handling Need for universal data model for message exchange
WS-BPEL is a language for defining processes that can be executed on an orchestration engine
The composition is called a process. The service that a process interacts with is called a partner.
The relationship between the process and its partner is called a partnerLinkType
Basic Activities
<invoke>
-To invoke a one-way or request/response operation on a portType offered by a partner
<receive>
-To do a blocking wait for a matching message to arrive -Instantiates the business process
<reply>
-To send a message in reply to a message that was received through a receive activity -The combination of a <receive> and a <reply> forms a request-response operation on the WSDL portType for the process
<assign>
-Can be used to update the values of variables with new data
<throw>
-Generates a fault from inside the business process
<wait>
-Allows you to wait for a given time period or until a certain time has passed
<empty>
-Allows you to insert a "no-op" instruction into a business
Structured Activities
<sequence>
-Perform activities in sequential order
<while>
-Supports repeated performance of a specified iterative activity -Iterative activity is repeated until the given while condition is no longer true.
<flow>
-Perform activities in parallel -Completes when all sequences in the flow are finished
<switch>
-Consists of one or more ordered <case> branches, each of them allow to specify a condition to be evaluated -Case branches are processed in their order of appearance, and the first branch with a true condition is processed -Each case branch may contain a sequence of activities -May have one <otherwise> branch, which is processed if all <case> conditions are false
<compensate>
-To undo & backtrack previously completed transactions
<scope>
-Enclose multiple activities in a single scope
Oracle Jdeveloper provides different templates for developing BPEL Web services. The most commonly used templates are1. 2. 3. Synchronous Service Asynchronous Service Define Interface later or Empty Service
Steps Contd.
Setting the BPEL Process Variable Message Types-Structures tab
Steps Contd.
Configuring Partnerlink to invoke a BPEL webservice
Steps Contd.
Assigning the data-Drag an assign activity from the component palette
Invoking a service
Below diagrams show how asynchronous BPEL process look initially (left) & post
Problem Solution
Solution:
Application should take care of message correlation Generate correlation information Pass correlation information in the message Use correlation Information to match the request to response
What is correlation id? Correlation id enables requestor to correlate the response sent by the provider
Exceptions are handled depends on the type of exceptions that can possibly occur. Exceptions that occur in a service-oriented composite application can be broadly classified into two categories-System Faults and Business Faults.
System Faults:
System faults are predefined. Most commonly used system faults are Remote, Binding, selection failure faults. These faults can be browsed & selected when configuring Throw/Catch activity. The system faults supported by BPEL engine are listed below
All the system faults share the same fault schema & contains following elements
1. 2. 3. Fault summary Fault detail Fault code
Business Faults:
A custom fault can be created by defining the same in bindings tag. SOAP fault structure is normally used to define a business fault & it will have following elements.
1.
2. 3. 4.
Fault Code
Fault String Fault Actor Fault detail
Example:
BPEL Activities used during Fault handling: Scope, Catch, CatchAll, Throw.
Q&A
29