You are on page 1of 32

Introduction to BPEL

Lesson Objectives

After completing this lesson, you should be able to do the following:


Build a synchronous BPEL process Deploy the BPEL process to the BPEL Server Initiate the process Manage and administer the process

Introduction to BPEL

BPEL:

Is a technology to create a program that can invoke web services but presents a very intuitive flow-chart type representation that can be easily understood and modified More technically, it is a markup language for composing a set of discrete services into an end-to-end process flow BPEL Process is a web service, hence has a WSDL document that describes its operation invokes operations described in interfaces in the WSDL of other services.

Orchestration Requirements

Process orchestration coordinates services in a process from a single run-time environment Orchestration should enable us to create:

Business processes from services and human activities Integration flows to integrate various applications

Orchestration requirements include:


Execution sequencing including serial, parallel, or other kinds of control flow dependency patterns Exception handling including transactions and compensations Data flow and manipulation Event handling including timers and other out-of-band events

Why am I telling you about Orchestration! BPEL is a standard for business process orchestration

BPEL Process Manager

Oracle BPEL Process Manager is implementation of the BPEL standard. The Oracle BPEL Process Manager consists of the three components. Each component enables you to perform a specific set of tasks:

The design environment (Oracle JDeveloper) enables you to design and deploy BPEL processes. The BPEL Server is where the process is deployed BPEL Control can be used to run and monitor the BPEL process

Describing Oracle BPEL Process Designer


Editor

Component Palette Application Navigator

Property Inspector Log Window

The Hello Process

Creating the Hello Process

Create connection to the application server and to the BPEL and ESB Server

Create the workspace and add project

Create a new workspace and a new BPEL synchronous project template

Create a skeleton synchronous process

By selecting Synchronous BPEL Process, a skeleton is created along with all of the necessary source files are created.

Anatomy of a BPEL Project


Workspace

Project file Schema file


BPEL deployment descriptor: Contains metadata regarding the Hello process BPEL source file: Definition of this BPEL process WSDL interface of this process: A client uses this interface to initiate the Hello BPEL process

Adding an Activity to the Process Flow


Example: Assigning text to an output message.

Drag an Assign activity and drop it between the receiveInput and replyOutput activities

Creating a Copy Rule

Viewing the WSDL Source

Types

Messages

Port types
Partner Links

BPEL Process Source Structure


<process> <!-- Partner Links Section: services --> <partnerLinks> <partnerLink name="service-name" .../> </partnerLinks> <!-- Process Variables Section: message data --> <variables> <variable name="var-name" messageType="type"/> </variables> <!-- ORCHESTRATION LOGIC --> <!-- Activity Flow Section: activities --> <sequence name="main"> <receive .../> <assign><copy><from...><to...></copy></assign> <reply .../> </sequence> </process>

BPEL Process Source Structure


The <process> element is the top-level element for <process> <!-- Partner Links Section: services --> the BPEL source code. <partnerLinks> <partnerLink name="service-name" .../> </partnerLinks> <!-- Process Variables Section: message data --> <variables> <variable name="var-name" messageType="type"/> </variables> <!-- ORCHESTRATION LOGIC --> <!-- Activity Flow Section: activities --> <sequence name="main"> <receive .../> <assign><copy><from...><to...></copy></assign> <reply .../> </sequence> </process>

BPEL Process Source Structure


<process> <!-- Partner Links Section: services --> <partnerLinks> <partnerLink name="service-name" .../> </partnerLinks> <!-- Process Variables Section: message data --> <variables> <variable name="var-name" messageType="type"/> </variables> The <partnerLinks> element contains a list of <!-- ORCHESTRATION LOGIC <partnerLink> elements defining services that --> <!-- Activity Flow Section: activities --> participate in the BPEL process. <sequence name="main"> <receive .../> <assign><copy><from...><to...></copy></assign> <reply .../> </sequence> </process>

BPEL Process Source Structure

<process> represent messages a <!-- Partner Links Section: services --> XML documents used <partnerLinks> activities in process. <partnerLink name="service-name" .../> </partnerLinks> <!-- Process Variables Section: message data --> <variables> <variable name="var-name" messageType="type"/> </variables> <!-- ORCHESTRATION LOGIC --> <!-- Activity Flow Section: activities --> <sequence name="main"> <receive .../> <assign><copy><from...><to...></copy></assign> <reply .../> </sequence> </process>

BPEL Process Source Structure


<process> <!-- Partner Links Section: services --> <partnerLinks> <partnerLink name="service-name" .../> The <sequence> element contains the orchestration logic, or </partnerLinks> process flow is comprised of a sequence of process flow. The <!-- Processcoordinate the flow of messages across the services activities that Variables Section: message data --> <variables> integrated within the business process. For example: <variable name="var-name" messageType="type"/> </variables> <!-- ORCHESTRATION LOGIC --> <!-- Activity Flow Section: activities --> <sequence name="main"> <receive .../> <assign><copy><from...><to...></copy></assign> <reply .../> </sequence> </process>

What next?

After development, the BPEL process needs to be deployed Deploying means putting the process in the BPEL server. Deployment can be achieved through

JDeveloper Command prompt

Deploying where?

If you want to use JDeveloper for deploying the process, you need to create connection from JDeveloper to the BPEL Server BPEL server is running in Application server

Recall that the application server houses BPEL, ESB and other servers Application Server Connection to the Oracle Application Server Integration Server Connection to the BPEL Server that utilizes the AS connection created above

Hence we need to create two connections

Creating Connection to AppServer


2 1 3

Create connection to BPEL Server


2 1

Building and Deploying the process


After creating the process, we need to compile and build it. When you build your process, all of the process components are packaged into a BPEL suitcase JAR file. The JAR file can be deployed to any Oracle BPEL Process Manager server, simply by copying it into the appropriate deployment directory. JDeveloper uses ANT to build the BPEL process. It generates a build.xml file that builds and deploys the suitcase to your local servers default domain, in this case %ORACLE_HOME%\bpel\domains\default\tmp

Deploying the process

To build and deploy the Hello BPEL process:


1.

2.

In the Applications Navigator, right-click the Hello project and select Deploy > MyBpelServer > Deploy to default domain. Verify that the process compiled and deployed successfully by reviewing the message text in the Messages tab in the Log window of JDeveloper

Deploying a BPEL process makes it a service. This is made possible by automatic addition of <service> and <binding> tag to the WSDL during deployment.

Oracle BPEL Console

BPEL Console lists all the deployed processes BPEL Console can be used for

Invoking a BPEL process with appropriate input Viewing completed, in process and failed instances Viewing the flow in an instance Viewing messages exchanged in an instance Deploying, undeploying a process Purging instance and sensor data BPEL Admin activities

BPEL Console Dashboard

The Dashboard shows all the deployed processes

Initiate a process

View the Response

See the Visual Flow of the process

Managing and Administering

BPEL console can be used to manage the process that includes


Viewing all in-flight, closed and failed instances Deploying a BPEL Process if jar is available Undeploying a BPEL process Bulk operations like undeploying, retiring Setting log levels

You might also like