You are on page 1of 80

2

Understanding Basic Concepts


and Architecture

Copyright © 2005, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:


• Identify the standards and architecture for service-
oriented architecture (SOA)
• Describe the basic concepts of Oracle BPEL
P
Process Manager
M
• Explain the Oracle BPEL Process Manager
architecture
• Describe Oracle Integration products
• Install and configure JDeveloper BPEL Designer
and Manager

2-2 Copyright © 2005, Oracle. All rights reserved.

Services and Composite Applications

A composite application combines multiple services,


applications, or systems.

Application for cell phone SMS Activation Manager


plan activation GPRS Activation Manager
Roaming Activation Manager

Application Automatic payment


New plan server approval
selection–
user Service not available
interface ADF exception

Process flow Credit check service


orchestration Billing services
Payment services
Credit card payment services

2-3 Copyright © 2005, Oracle. All rights reserved.

1
Service-Oriented Architecture

Service-oriented architecture (SOA) is:


• An architectural style for loose coupling
between interacting software agents
• A set of components that can be invoked
• Enabled through a set of standards

Service request
Service Service
consumer provider
Service response

2-4 Copyright © 2005, Oracle. All rights reserved.

Life Cycle of Service-Oriented Architecture


Applications

Develop
services

Secure Compose
and federate services

Provision Orchestrate
and manage services

Discover and
access

2-5 Copyright © 2005, Oracle. All rights reserved.

Service-Oriented Architecture:
Components
APPLICATION
Portals
.NET client Web client Portal J2EE applications
(Support) (Self-service) (Self-service) Servlets

PROCESS FLOWS
BPEL
Orchestration XSLT
XQuery

WS-Security
Management and security
WS-Policy, SAML

WSDL WSDL WSDL WSDL WSDL BUSINESS


SERVICES
SOAP JDBC JMS JCA RMI
XML, XML schema
WSDL/WSIF
SOAP, JCA, JMS
.NET/Axis Database Mainframe Packaged EJBs
apps

2-6 Copyright © 2005, Oracle. All rights reserved.

2
Introducing Web Services

Web services:
• Are self-describing business functions
• Allow connections between services from any
Web-connected device by using:
– A set of standard messaging protocols
– Programming standards
– Network registration

Request

Response
Web browser Web service

2-7 Copyright © 2005, Oracle. All rights reserved.

Web Service Architecture and Standards

Find WSIL Locate


browser

Find Register
3 2 (UDDI)
(UDDI)

Generate
Web services 1 WSDL
directory
4 Invoke request (SOAP) Interface
Internet (WSDL)

5 Send response Service


Web service (SOAP) implementation
Client application
Web service

2-8 Copyright © 2005, Oracle. All rights reserved.

Notes Only Page

2-9 Copyright © 2005, Oracle. All rights reserved.

3
SOAP Message Structure

SOAP message A SOAP message is a unit of


HTTP headers communication, containing:
• Optional HTTP headers
SOAP envelope 1
• An envelope enclosing the
SOAP header 2 payload
Headers • A SOAP header with zero
or more headers blocks
SOAP body 3 • A SOAP body containing a
collection of zero or more
Message name message elements
and data
• XML-encoded style
message elements, with
SOAP content styles the doc-literal style, as
RPC-encoded Doc-literal recommended by the WS-
Doc-encoded RPC-literal Interoperability standard

2-10 Copyright © 2005, Oracle. All rights reserved.

A SOAP Example

Request <SOAP-ENV:Envelope>
<SOAP-ENV:Body>
(RPC-literal) <GetStockQuote
xmlns="urn:stock-quotes" >
<StockSymbol>ORCL</StockSymbol>
</GetStockQuote>
</SOAP ENV B d >
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

<SOAP-ENV:Envelope>
Response <SOAP-ENV:Body>
(RPC-literal) <GetStockQuoteResponse
xmlns="urn:stock-quotes" >
<USD_Price>15.25</USD_Price>
</GetStockQuoteResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

2-11 Copyright © 2005, Oracle. All rights reserved.

Service Invocation

Services can be:


• Synchronous <creditRating>
560
</creditRating>

C llb k
Callback 10:05 Receive order
location
• Asynchronous 10:10 Processing
….
10:25 <risk>4</risk>

<Patient>
Disease A
• Secured </Patient>

Network-centric

2-12 Copyright © 2005, Oracle. All rights reserved.

4
Orchestrating Services Through BPEL

Web service
Portal

Java service

?
Database
c stored procedures

J2EE ERP
SAP, Oracle
BPEL

UI User tasks
Tomcat

2-13 Copyright © 2005, Oracle. All rights reserved.

What Is BPEL?

BPEL is:
• A markup language for composing a set of
discrete services into an end-to-end process flow
• A mechanism for asynchronous interactions,
parallel processing,
processing and exception management
<process>
SalesDB Start <partnerLinks>
<partnerLink name="service-name"
Duplicate ... />
</partnerLinks>
number! <variables>
<variable name="var-name"
messageType="type"/>
</variables>
<sequence name="main">
<receive .../>
<assign>
<copy><to.../><from.../></copy>
</assign>
Router Billing <reply .../>
</sequence>
End </process> BPEL source

2-14 Copyright © 2005, Oracle. All rights reserved.

Benefits of BPEL

BPEL:
• Integrates a set of services to implement business
processes
• Defines a sequence of activities, called a process
flow using a standard XML application language
flow,
• Supports definition and invocation of
synchronous and asynchronous services
• Enables structured message data to be exchanged
with invoked services
• May be constructed visually with designer tools,
such as JDeveloper BPEL Designer
• Provides its process flow as a service

2-15 Copyright © 2005, Oracle. All rights reserved.

5
Standards: Building Blocks of BPEL

Choreography: CDL4WS Business


processes
Orchestration: BPEL4WS

Transactions
Quality of
ment

WS-reliability WS-security Coordination service


Managem

Context

UDDI Discovery

WSDL Description

SOAP
Message
XML
HTTP, IIOP, JMS, SMTP Transport

2-16 Copyright © 2005, Oracle. All rights reserved.

Oracle BPEL Process Manager


Architecture

• Plug-and-play JDeveloper,
• Cross-platform Deploy Eclipse
• Scalable BPEL BPEL
Designer
BPEL Process Manager
WSDL binding Built-in integration services
Web service
XQuery XSLT User Java/ Develop
Java, JMS, JCA tasks J2EE
File, FTP BPEL
Database
Core BPEL engine Console
iWay

J2EE application server Dehydration


(Oracle AS, WebLogic, JBoss, WebSphere) store Manage
(Oracle DB)

2-17 Copyright © 2005, Oracle. All rights reserved.

Notes Only Page

2-18 Copyright © 2005, Oracle. All rights reserved.

6
Oracle BPEL Process Manager:
Key Features

BPEL WSDL BPEL BPEL


Designer Bindings Engine Console

Modeling Connectivity Execution run time Management


MANAGEMENT

• Comprehensive BPEL 1.1 • Bindings to 100+ backend • Comprehensive BPEL 1.1 • Visual monitoring
• Visual modeling tool systems (JCA) • Sync. messaging • Auditing
• Native Java embedding • JMS bridge • Async. messaging • BPEL debugging
• XML facade • .NET, Axis, Workshop, • Context dehydration • In-flight administration
Glue, Systinet, interop
• XQuery transformation • Reliability • Performance tuning
• User tasks/workflow
• Detailed error reporting • Side-by-side versioning • Task management
• E-mail with attachment
• Ant-based build and • Compensating transactions • Partitioning/Domains
deployment framework • Clustering
• Versioning • Large XML documents

BPEL, XQuery, XSLT, WS-ADDRESSING

Application server (Oracle, WebLogic, WebSphere, JBoss)

2-19 Copyright © 2005, Oracle. All rights reserved.

BPEL Process Manager Server

Domains
BPEL default
suitcase BPEL
jar
deploy
BPEL process manager
BPEL
Designer WSDL adapters Built-in integration services
Web service
Oracle DB
Xquery/ Workflow Sensors
JMS
XSLT service
JCA
Database
Core BPEL engine BPEL
Files Console

J2EE application server


(Oracle AS, WebLogic, JBoss, WebSphere)
Manage

2-20 Copyright © 2005, Oracle. All rights reserved.

Core Engine Architecture

2 3
BPEL Project 1.0
Delivery Dispatcher
Console

Loader Lifecycle
4
Manage
g
1 Persistence P j t 1.1
Project 11
service
Console
Client
API Write-through
cache
Java delegate
Engine
JCA Adapters
SOAP gateway
WSIF Java J2EE code
Worklist
JMS Messaging

2-21 Copyright © 2005, Oracle. All rights reserved.

7
Notes Only Page

2-22 Copyright © 2005, Oracle. All rights reserved.

Performance and Scalability

Write-through cache
BPEL-optimized BPEL
SOAP stack server
App. server Compact binary DOM
Lazy loading
Load balancer

• Smart partitioning
• W3C DOM interface
• Support for large
BPEL
server documents
App. server
Dehydration store
(Oracle database)
Stateless BPEL
server Support for large BPEL
architecture processes (20,000+ activities)
• Clustering App. server
• Failover

2-23 Copyright © 2005, Oracle. All rights reserved.

Service Adapters

WSDL .NET, Axis Web services

WSDL Java, JCA components

WSDL Database

WSDL Oracle E-Business Suite

WSDL Files

WSDL JMS queue or topic

BPEL WSDL 200+ iWay adapters

XML,WSIF,JCA

2-24 Copyright © 2005, Oracle. All rights reserved.

8
Integrated Adapters

2-25 Copyright © 2005, Oracle. All rights reserved.

Oracle Application Server Adapters


Enterprise-strength infrastructure for connectivity to
Enterprise Information Systems (EIS)
• Bidirectional connectivity
• Service-oriented
architecture (SOA)
Oracle Application Server
E-Business • Open standards support
BPEL PM Suite – WSIF
OC4J
Native – WSDL
J2CA APIs
B2B Adapter – J2CA
– WSIL
Legacy
InterConnect applications – SOAP
SOAP BSE
request/ WSDL/ • Managed through Oracle
BAM response
SOAP application server
• Seamless integration with
Packaged Oracle products
Repository API
applications
XSD
repository
File/FTP, JMS,
AQ, RDBMS

2-26 Copyright © 2005, Oracle. All rights reserved.

Data Transformation Services

The BPEL Designer provides:


• A built-in data transformation component
• An XSLT Mapper that uses XPath, XSD, and XSL to
specify transformations visually
• A test tool to perform in-line
transformation tests during
development

2-27 Copyright © 2005, Oracle. All rights reserved.

9
Oracle BPEL Process Manager:
Methodology

Expose
services Flow Transformation Exception

User
tasks
workflow
Change

Unit test

Monitor Sensors Audit Performance test

2-28 Copyright © 2005, Oracle. All rights reserved.

Oracle Integration

InterConnect B2B Data Hub BPM BAM

Messaging Transformation Routing Adapters

Enterprise Service Bus

2-29 Copyright © 2005, Oracle. All rights reserved.

Oracle Integration InterConnect

Transformation Routing iStudio

Messaging

Adapter Adapter Adapter Adapter Oracle


database

SAP Database MQ series Java

2-30 Copyright © 2005, Oracle. All rights reserved.

10
Oracle Integration B2B

Trading partner
management

E-Business
Suite Oracle AS integration B2B server
Security MIME, S/MIME
Transport
Legacy HTTPs, FTPs, File, SMTP, IMAP
applications
Document interfaces Exchange interfaces

PIP EDI Generic RNIF AS2 Generic


Packaged
applications
Core B2B engine

Oracle
File/FTP, JMS, Oracle application server
AQ, RDBMS database

2-31 Copyright © 2005, Oracle. All rights reserved.

Oracle Integration BAM

BPEL Oracle integration BAM


PM Sensors BAM Dashboard
Modeling
BPEL PM

B2B
B ilt i processors
Built-in
B2B InterConnect
engine
SDK Correlation KPI Alerts

InterConnect

Actual Target
cube cube

Oracle database

2-32 Copyright © 2005, Oracle. All rights reserved.

Installing Oracle BPEL Software

2-33 Copyright © 2005, Oracle. All rights reserved.

11
Oracle BPEL Process Manager:
Components

Oracle BPEL
Process
Manager
JDeveloper Oracle Lite BPEL
BPEL Designer Console
database

2-34 Copyright © 2005, Oracle. All rights reserved.

Creating Connections

Use the JDeveloper


Connections - Navigator to
create connections for:
The BPEL Process
Manager Server
A database, such as the
Oracle Lite database

2-35 Copyright © 2005, Oracle. All rights reserved.

Creating the BPEL PM Server Connection

2-36 Copyright © 2005, Oracle. All rights reserved.

12
Creating the Database Connection

1 2

2-37 Copyright © 2005, Oracle. All rights reserved.

Creating the Database Connection

4 5

2-38 Copyright © 2005, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:


• Identify the standards and architecture for SOA
• Describe the basic concepts of Oracle BPEL
Process Manager
• Explain the Oracle BPEL Process Manager
architecture
• Describe Oracle Integration products
• Install and configure JDeveloper BPEL Designer
and Manager

2-39 Copyright © 2005, Oracle. All rights reserved.

13
Practice for Lesson 2
Installing BPEL Designer and Process Manager

2-40 Copyright © 2005, Oracle. All rights reserved.

14
3
Building a Simple BPEL Process

Copyright © 2005, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:


• Use JDeveloper BPEL Designer to design a simple
BPEL process
• Create a synchronous BPEL process
• Deploy the BPEL process
• Use the run-time server to run the process
• Manage and administer the process

3-2 Copyright © 2005, Oracle. All rights reserved.

The BPEL Standard


Some of the key foundation points of BPEL are:
• Asynchrony: Asynchronous interactions
• Flow coordination: Parallel flow of execution
• Exception management: Handling exceptions

SalesDB Start

Duplicate
number!
Billing

Router

End

3-3 Copyright © 2005, Oracle. All rights reserved.

1
Notes Only Page

3-4 Copyright © 2005, Oracle. All rights reserved.

JDeveloper BPEL Designer


Editor pane
Component Palette

Applications -
Navigator

Structure pane
Message log

3-5 Copyright © 2005, Oracle. All rights reserved.

The HelloWorld Process

Request:
<input>Name</input>

Response:
<result>Hello Name</result>
Client HelloWorld
BPEL process

Concatenate

"Hello " + Name

3-6 Copyright © 2005, Oracle. All rights reserved.

2
Creating the HelloWorld Process

1 2 Create a workspace
Create
and a synchronous
connections.
BPEL project.
3
Assign text to
output message.

4
Build,
deploy,
and test.

3-7 Copyright © 2005, Oracle. All rights reserved.

Creating a New Workspace

3-8 Copyright © 2005, Oracle. All rights reserved.

Creating a New Project

1
2

3-9 Copyright © 2005, Oracle. All rights reserved.

3
Initial State of the BPEL Process

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

3-10 Copyright © 2005, Oracle. All rights reserved.

Anatomy of a BPEL Project

Workspace

Project file

BPEL deployment descriptor:


Contains metadata regarding
the HelloWorld process

BPEL source file:


Defines this BPEL process

WSDL interface of this process:


Initiates the HelloWorld BPEL
process

3-11 Copyright © 2005, Oracle. All rights reserved.

Adding an Assign Activity to the Process

• Copies text from a source to an output message


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

3-12 Copyright © 2005, Oracle. All rights reserved.

4
Creating a Copy Rule

1 2

XPath expression
3
builder icon

3-13 Copyright © 2005, Oracle. All rights reserved.

Using the XPath Expression Builder

Function
types
3

3-14 Copyright © 2005, Oracle. All rights reserved.

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>

3-15 Copyright © 2005, Oracle. All rights reserved.

5
BPEL Activities in HelloWorld

The <sequence> activity, which contains:


• A <receive> activity
• An <assign> activity, which includes a <copy>
element with:
– A <from> element
l t specifying
if i the
th source off data
d t
– A <to> element specifying the destination for data
• A <reply> activity
Note: BPEL variables are used to store data that is
used by activities and communicated between clients
and services.

3-16 Copyright © 2005, Oracle. All rights reserved.

The HelloWorld BPEL Source

<sequence name="main">
<receive name="receiveInput" partnerLink="client"
portType="client:HelloWorld"
operation="process" variable="inputVariable"
createInstance="yes"/>
<assign name="createReturnStr">
<copy>
<from expression="concat(&quot;Hello
&quot; bpws:getVariableData('inputVariable' 'pa
&quot;,bpws:getVariableData('inputVariable','pa
yload','/client:HelloWorldProcessRequest/client
:input'))"/>
<to variable="outputVariable" part="payload"
query="/client:HelloWorldProcessResponse/client
:result"/>
</copy>
</assign>
<reply name="replyOutput" partnerLink="client"
portType="client:HelloWorld"
operation="process" variable="outputVariable"/>
</sequence>

3-17 Copyright © 2005, Oracle. All rights reserved.

Notes Only Page

3-18 Copyright © 2005, Oracle. All rights reserved.

6
BPEL Depends on WSDL and WSDL
Extensions

Service Service
implementation
definition Port

Binding

Service Port types define operations


interface
definition Message

Type

3-19 Copyright © 2005, Oracle. All rights reserved.

The HelloWorld Design-Time WSDL


Source
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="HelloWorld" ...>
<types><schema ...>
<element name="HelloWorldProcessRequest">
<complexType><sequence>
<element name="input" type="string"/>
</sequence></complexType>
</element> ...
</schema></types>
<message name="HelloWorldRequestMessage">
<part name="payload"
element="client:HelloWorldProcessRequest"/>
</message> ...
<portType name="HelloWorld">
<operation name="process">
<input
message="client:HelloWorldRequestMessage"/>
<output
message="client:HelloWorldResponseMessage"/>
</operation></portType> ...
</definitions>

3-20 Copyright © 2005, Oracle. All rights reserved.

Notes Only Page

3-21 Copyright © 2005, Oracle. All rights reserved.

7
Validating and Deploying a BPEL Process

Validation and deployment can be performed by using:


• Command-line tools and scripts installed with
Oracle BPEL Process Manager
• Oracle JDeveloper BPEL Designer
HelloWorld project
obant bpelc BPEL PM
server
Build
bpel.xml Domain
HelloWorld.bpel default

Deploy
HelloWorld.wsdl bpel_HelloWorld_1.0.jar

3-22 Copyright © 2005, Oracle. All rights reserved.

Deployment with JDeveloper

3
4

3-23 Copyright © 2005, Oracle. All rights reserved.

The BPEL Suitcase

<?xml version = '1.0' encoding = 'UTF-8'?>


<BPELSuitcase>
<BPELProcess id="HelloWorld"
src="HelloWorld.bpel">
<partnerLinkBindings>
<partnerLinkBinding name="client">
<property name="wsdlLocation">
HelloWorld.wsdl</property>
</partnerLinkBinding>
</partnerLinkBindings>
</BPELProcess>
</BPELSuitcase>

bpelc
Deployment directory:

3-24 Copyright © 2005, Oracle. All rights reserved.

8
Notes Only Page

3-25 Copyright © 2005, Oracle. All rights reserved.

Testing the Process


1

3-26 Copyright © 2005, Oracle. All rights reserved.

Auditing and Debugging the Instance

3-27 Copyright © 2005, Oracle. All rights reserved.

9
BPEL Activities

Primitive activities: Structured activities:


<invoke> <sequence>
<receive> <switch>
<assign> <pick>
<
<reply>
l > <fl >
<flow>
<throw> <while>
<terminate> <scope>
<wait> Note: These activities may
contain primitive and
structured activities.

3-28 Copyright © 2005, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:


• Use JDeveloper BPEL Designer to design a simple
BPEL process
• Create a synchronous BPEL process
• Deploy the BPEL process
• Use the run-time server to run the process
• Manage and administer the process

3-29 Copyright © 2005, Oracle. All rights reserved.

Practice 3: Creating the HelloWorld


Process

3-30 Copyright © 2005, Oracle. All rights reserved.

10
4
Orchestrating Services with BPEL

Copyright © 2005, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:


• Choose the appropriate JDeveloper BPEL
Designer templates
• Orchestrate services in BPEL by:
– Invoking a synchronous service
– Invoking an asynchronous service
• Describe how WS-Addressing is used to enable
asynchronous service invocation

4-2 Copyright © 2005, Oracle. All rights reserved.

Orchestrating Services Through BPEL

Web service
Portal

Java service

?
Database
stored procedures

J2EE ERP,
SAP, Oracle
BPEL

User tasks
UI
TOMCAT

4-3 Copyright © 2005, Oracle. All rights reserved.

1
Developing a BPEL Service

• A BPEL process is a service that may be invoked


by other services.
• A BPEL service can be developed by:
– Using a visual design tool such as Oracle BPEL
Designer
– Editing the BPEL elements with a text editor
• Using Oracle BPEL Designer templates, you can
start to create the BPEL services for:
– A synchronous service
– An asynchronous service
– An empty service

4-4 Copyright © 2005, Oracle. All rights reserved.

Initial Structure of a Synchronous Service

To call this
process
To receive input

To return output

4-5 Copyright © 2005, Oracle. All rights reserved.

Initial Structure of an
Asynchronous Service

To call this
process
To receive input

For the
asynchronous
callback

4-6 Copyright © 2005, Oracle. All rights reserved.

2
Initial Structure of an Empty Service

E t
Empty
process

To design a process flow as a client


to initiate other services

4-7 Copyright © 2005, Oracle. All rights reserved.

Synchronous Services

A synchronous service:
• Processes input
• Returns an immediate response
Example: Invoking a credit rating Web service
Web service
CreditRatingRequestMessage
Functional building
block process
CreditRatingResponseMessage
returns credit rating.

Self-described
interface (WSDL)
Transport
(SOAP over HTTP)

4-8 Copyright © 2005, Oracle. All rights reserved.

Partner Links and Service Invocation

Invoking a BPEL process requires:


• A <partnerLink> that encapsulates a definition
of how to access a service by using WSDL
• An <invoke> activity to initiate an operation
provided
id d by
b the
th service
i

Client Service
Invoke
Partner Partner
link BPEL process link

WSIL
Service description
browser (WSDL)

4-9 Copyright © 2005, Oracle. All rights reserved.

3
Partner Links
Deployment descriptor (bpel.xml)

inputVariable
<variable>
Request Message
d1 <receive>

prepare crInput
<assign> Credit service
crInput
nk
on

<variable> Partner link


partner lin
applicatio

d3
Client

Client

Call service
<invoke> d4
crOutput
<variable> Credit
Read crOutput rating
<assign>
WSDL service

d2 <reply>
outputVariable
<variable>
Response Message
WSDL
BPEL process

4-10 Copyright © 2005, Oracle. All rights reserved.

Invoking a Synchronous Service

1. Create a PartnerLink.
2. Use an Assign activity
to prepare the input.
3. Add an Invoke activity 2 1
t iinvoke
to k th
the service.
i
4. Add an Assign activity
3
to obtain the output.

Note: The Invoke activity 4


provides input and output
variables for a
synchronous service.

4-11 Copyright © 2005, Oracle. All rights reserved.

Creating the OrderBooking BPEL Process

Create an OrderBooking BPEL project with the


Asynchronous BPEL Process template.

4-12 Copyright © 2005, Oracle. All rights reserved.

4
Importing a User-Defined XML Schema
3

2
5

4-13 Copyright © 2005, Oracle. All rights reserved.

Setting the BPEL Process Message Types

Note: You can set the message type by editing either


the message type name or its payload.

4-14 Copyright © 2005, Oracle. All rights reserved.

Including a Partner Link

Drag the PartnerLink activity into the Diagram View.

4-15 Copyright © 2005, Oracle. All rights reserved.

5
Configuring the Partner Link Activity

1 3
2

4-16 Copyright © 2005, Oracle. All rights reserved.

BPEL Variables

• Communicate data between services and activities


used by a BPEL processes
• Have a built-in data, element, or message type
– Element types are defined as XML schemas.
– The
Th message type
t structure
t t is
i defined
d fi d as an XML
schema element type and is defined in WSDL.
BPEL process
Process variable XML schema
Defined as <types>
Scope

Data variable WSDL </types>
Message type
Defined in

4-17 Copyright © 2005, Oracle. All rights reserved.

Creating the Input Variable


1

Select this
3 message type.

Confirm this URL.

4
5

Note: You can also autogenerate variables.

4-18 Copyright © 2005, Oracle. All rights reserved.

6
Creating the Output Variable

Select this
message type.
3

Confirm this URL.

4
5

4-19 Copyright © 2005, Oracle. All rights reserved.

Synchronous Flow: Invoking the Credit


Rating Service

1
2

4
Click to
autogenerate a
variable.
Click to browse for
5 an existing variable.

4-20 Copyright © 2005, Oracle. All rights reserved.

Assigning Input Data


Drag an Assign activity into the Diagram View
between receiveInput and InvokeCR.

4-21 Copyright © 2005, Oracle. All rights reserved.

7
Configuring Assign Activity Copy Rules

2 3

4-22 Copyright © 2005, Oracle. All rights reserved.

Assigning the Output


1

3
2

There are two


copy rules for this
assignment.
4

4-23 Copyright © 2005, Oracle. All rights reserved.

Viewing the BPEL Process

4-24 Copyright © 2005, Oracle. All rights reserved.

8
Deploying and Running the Process
1

4-25 Copyright © 2005, Oracle. All rights reserved.

Reviewing the Source Code


<!--// Partner Links Section-->
<partnerLinks xmlns:plext=
"http://schemas.oracle.com/bpel/extension/partnerlink">
<partnerLink myRole="OrderBookingProvider" name="client"
partnerRole="OrderBookingRequester"
plext:wsdlloc="OrderBooking.wsdl"
partnerLinkType="client:OrderBooking"/>
<partnerLink myRole="CreditRatingServiceProvider"
name="CreditService"
partnerRole="CreditRatingServiceProvider"
plext:wsdlloc="http://edrsr6p1:9700/orabpel/default/C
reditRatingSer ice/CreditRatingSer ice? sdl"
reditRatingService/CreditRatingService?wsdl"
partnerLinkType="ns2:CreditRatingService"/>
</partnerLinks>
<!--// Process Variables Section-->
<variables>
<variable name="inputVariable"
messageType="client:OrderBookingRequestMessage"/>
<variable name="outputVariable"
messageType="client:OrderBookingResponseMessage"/>
<variable name="crInput"
messageType="ns2:CreditRatingServiceRequestMessage"/>
<variable name="crOutput"
messageType="ns2:CreditRatingServiceResponseMessage"/>
</variables>

4-26 Copyright © 2005, Oracle. All rights reserved.

Reviewing the Source Code


<sequence name="main">
<receive name="receiveInput" partnerLink="client"
portType="client:OrderBooking" operation="initiate"
variable="inputVariable" createInstance="yes"/>
<assign name="AssignCR">
<copy>
<from variable="inputVariable" part="payload"
query="/ns1:PurchaseOrder/ns1:ID"/>
<to variable="crInput" part="payload"
query="/ns2:ssn"/>
</copy>
</assign>
<invoke name="invokeCR" partnerLink="CreditService"
portType="ns2:CreditRatingService"
operation="process"
operation= process inputVariable=
inputVariable="crInput"
crInput
outputVariable="crOutput"/>
<assign name="AssignRating">
<copy>
<from expression="string(&quot;Credit OK&quot;)"/>
<to variable="inputVariable" part="payload" query=
"/ns1:PurchaseOrder/ns1:OrderInfo/ns1:OrderComments"/>
</copy>
<copy>
<from variable="crOutput" part="payload"
query="/ns2:rating"/>
<to variable="outputVariable" part="payload" query=
"/client:OrderBookingProcessResponse/client:result"/>
</copy>
</assign>
<invoke name="callbackClient" partnerLink="client"
portType="client:OrderBookingCallback"
operation="onResult" inputVariable="outputVariable"/>
</sequence>

4-27 Copyright © 2005, Oracle. All rights reserved.

9
Notes Only Page

4-28 Copyright © 2005, Oracle. All rights reserved.

Invoking an Asynchronous Service

Asynchronous services:
• Are initiated by using an Invoke activity
• Can take any amount of time to complete
• Use WS-Addressing information to call back a
BPEL process Receive activity waiting for the
response [2:05] receive
Initiate port [2:06] process…
[2:22] callback

Initiate
Callback port Rapid Distributors
asynchronous
onResult callback Web service

4-29 Copyright © 2005, Oracle. All rights reserved.

WS-Addressing and Correlation

WS-Addressing header:
• callback location
• correlation ID (relatesTo) [2:05] receive
[2:06] process…
[2:22] callback

RapidDistributers
RDInput
P t
PartnerLink
Li k
<variable>
Initiate service Initiate port
d3 d3
<invoke>

Wait for callback Callback port Async


<receive> d4 d4 Rapid
Distributor
RDOutput WSDL service
<variable>
WS-Addressing header:
BPEL process: • correlation ID (relatesTo)
OrderBooking.bpel

4-30 Copyright © 2005, Oracle. All rights reserved.

10
Implementing Correlation Sets

To implement a correlation set:


Create property
1 Create 2 aliases associated
properties. with message type
WSDL WSDL elements.
BPEL process 3 BPEL process
Define Create correlation Define
<correlationSets> set based on <correlationSets>
Invoke property aliases.
Receive
Use Associate
<correlation 4
<correlation
initiate="no"> Use or associate
correlation set. initiate="yes">

Note: This is necessary only for asynchronous calls


when WS-Addressing is not provided by BPEL engine.

4-31 Copyright © 2005, Oracle. All rights reserved.

Understanding the BPEL Asynchronous


Service
Deployment descriptor (bpel.xml)
Client
Partner inputVariable
Client Link <variable>
application d1 <receive>

Prepare order
<assign> Rapid
RDInput Distributors
<variable> PartnerLink
Initiate service d3
<invoke> Initiate port

Wait for callback d4


Callback Async
<receive> port
RDOutput service
<variable> WSDL

d2 Client
<callback>
outputVariable Dehydration point
WSDL <variable>
BPEL process

4-32 Copyright © 2005, Oracle. All rights reserved.

Including a Partner Link for


Rapid Distributors

Create a partner link for the Rapid Distributors service


that assigns a supplier based on the items ordered.

• My Role must be
specified for
asynchronous calls.
• Partner Role is
selected from those
provided by service.

4-33 Copyright © 2005, Oracle. All rights reserved.

11
Invoking the Rapid Distributors Service

Note: Autogenerated variable names are formed with


the activity name and invoked operation name.

4-34 Copyright © 2005, Oracle. All rights reserved.

Configuring a Receive Activity

4-35 Copyright © 2005, Oracle. All rights reserved.

Configuring the Variable Assignment

4-36 Copyright © 2005, Oracle. All rights reserved.

12
Viewing the Asynchronous Process
Activities

Note: Onlyy the order items


are sent, and not the entire
PO.

4-37 Copyright © 2005, Oracle. All rights reserved.

Deploying and Running the Process


2
1

4-38 Copyright © 2005, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:


• Choose the appropriate JDeveloper BPEL
Designer templates
• Orchestrate services in BPEL by:
– Invoking a synchronous service
– Invoking an asynchronous service
• Describe how WS-Addressing is used to enable
asynchronous service invocation

4-39 Copyright © 2005, Oracle. All rights reserved.

13
Practice 4: Invoking Synchronous and
Asynchronous Services

Practice 4.1: Invoking a


synchronous service
Practice 4.2: Invoking an
asynchronous service

4-40 Copyright © 2005, Oracle. All rights reserved.

14
6
Increasing Process Reliability Through
Fault Handling and Exception Management

Copyright © 2005, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:


• Provide a shared context for a subset of activities
through the use of the Scope activity
• Define various handlers to influence process
b h i
behavior

6-2 Copyright © 2005, Oracle. All rights reserved.

Defining a Scope Structure

A BPEL scope:
• Is implicit or appears in the <scope> element
• Defines a set of nested activities
• Provides its own associated:
– Fault handlers
– Event handlers
– Compensation handlers
– Data variables
• Controls the behavior of a process
• Can be nested within other scopes

6-3 Copyright © 2005, Oracle. All rights reserved.

1
Adding a Scope Structured Activity

Expand or collapse the view 2


Scope variable 1
Add Catch Branch
Add CatchAll Branch
g Branch
Add OnMessage
Add OnAlarm Branch
Add Compensation Handler
Hide/Show fault handlers
3

6-4 Copyright © 2005, Oracle. All rights reserved.

Catch and CatchAll

A BPEL scope provides fault handlers by using:


• A Catch branch (zero or more)
– Handles a specific (named) fault condition
– Obtains error information in a fault variable
– First
Fi t matching
t hi condition
diti iis processed d
• A CatchAll branch (optionally one)
– Processes any type of fault condition not handled
by a Catch branch
– Provides attributes to name the branch
Note: If a fault-handler is not present for any error
condition, the default BPEL Process Manager fault-
handling rules are applied.

6-5 Copyright © 2005, Oracle. All rights reserved.

Managing Faults

Nested scopes form a logical hierarchy:


• For activities and fault handlers
• That can be used to handle and propagate faults
Main scope
p
Assign
Inner Invoke
Invoke Credit rating
scope Raised service
Catch Defines
NegativeCredit WSDL
NegativeCredit
Catch Raised
CatchAll
InvalidSSN

6-6 Copyright © 2005, Oracle. All rights reserved.

2
Adding a CatchAll Exception Branch

In the Scope activity, click


the Add CatchAll Branch
icon to create an exception
branch known as a fault
handler
handler.

Exception branch

6-7 Copyright © 2005, Oracle. All rights reserved.

Setting a Value for the Credit Rating

The credit rating


value is set to 0.
2

6-8 Copyright © 2005, Oracle. All rights reserved.

Adding Comments to the Order

6-9 Copyright © 2005, Oracle. All rights reserved.

3
The CatchAll in the OrderBooking
Process

CatchAll

6-10 Copyright © 2005, Oracle. All rights reserved.

Deploying and Running the Process

1 2

6-11 Copyright © 2005, Oracle. All rights reserved.

Understanding BPEL Concepts:


Pick and onAlarm

Initiate service
<invoke>
<pick>

Wait for callback Timeout in 1M


<onMessage>
SelectManfacturing
<onAlarm>

Logic Logic A Pick activity triggers


post post
callback timeout either an onMessage or an
onAlarm after invoking an
asynchronous service.
BPEL Process

6-12 Copyright © 2005, Oracle. All rights reserved.

4
Pick with an <onMessage> and <onAlarm>

<sequence name="main">
<receive name="receiveInput" partnerLink="client"
portType="client:Test" operation="initiate"
variable="inputVariable" createInstance="yes"/>
<invoke name="Inv_SM"
partnerLink="SelectManufacturing"
portType="ns4:SelectManufacturing"
operation="initiate"
inputVariable="Inv_SM_initiate_InputVariable"/>
<pick name="Pick
name Pick_11">
>
<onMessage>
<receive name = "Receive_SM"
partnerLink="SelectManufacturing"
portType="ns4:SelectManufacturing"
operation="onResult"
variable="Receive_SM_onResult_InputVariable"
createInstance="no"/>
</onMessage>
<onAlarm for="'PT3M1S'">
<sequence name="Sequence_5"><assign ... /> ...
</sequence>
</onAlarm>
</pick>

6-13 Copyright © 2005, Oracle. All rights reserved.

Understanding Compensating
Transactions

• ACID principles and XA transactions do not work


for asynchronous services.
• Transactions can be managed for synchronous
services provided that all invocations are
synchronous
synchronous.
• Use BPEL compensation handling:
– When the BPEL process encounters a failure
– To undo the previously completed transactions
• Example: Travel agent needs to undo some
booking operations for a customer in the event of
some services offered being unavailable.

6-14 Copyright © 2005, Oracle. All rights reserved.

Compensating Transactions

TravelFlow Port TravelFlow


BPEL Process PTa

1. Do
Da Airline
Ua 6. Compensate/Undo
Explicit
p Invocation
PTb
Drc 2. Do
Urc 5. Compensate Rental
Explicit Invocation
car
3. Do
Dh
4. No hotel
Uh available! PTc

Exception! Hotel
Undo!

6-15 Copyright © 2005, Oracle. All rights reserved.

5
Understanding the BPEL
compensationHandler

Using a compensate handler activity requires:


• Support for an undo operation in services invoked
• Definition of a compensation handler for a scope
• Triggering a compensation with a compensate
activity (commonly in another scope's fault
handler)
• Completing activities in scope before it can be
compensated
• Maintaining variable states in the server for a
scope that can be compensated

6-16 Copyright © 2005, Oracle. All rights reserved.

Notes Only Page

6-17 Copyright © 2005, Oracle. All rights reserved.

Adding a Compensation Handler

Each scope can have one compensation handler.


Similar to a fault handler, a compensation
handler can use arbitrary activities to implement
the compensation logic.

6-18 Copyright © 2005, Oracle. All rights reserved.

6
Summary

In this lesson, you should have learned how to:


• Provide a shared context for a subset of activities
through the use of the Scope activity
• Define various handlers to influence process
b h i
behavior

6-19 Copyright © 2005, Oracle. All rights reserved.

Practice 6:
Adding a Branch for Exception Handling

6-20 Copyright © 2005, Oracle. All rights reserved.

7
7
Adding Transformation Services to BPEL

Copyright © 2005, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:


• Add transformation services
• Configure mapping by using the XSLT Mapper
• Test the transformation

7-2 Copyright © 2005, Oracle. All rights reserved.

Oracle BPEL Process Manager


Transformation Services

Transformation services allow you to:


• Convert one document format to another
• Simplify copying data between large and complex
structures

XSLT Mapper

OrderBookingPO.xsd Transform.xsl POAcknowledge.xsd

POAcknowledge
BPEL process

XSLT
PurchaseOrder.xml POAcknowledge.xml

7-3 Copyright © 2005, Oracle. All rights reserved.

1
Adding Transformation Services

1. Drag a Transform activity to a BPEL service.


2. Configure source, target, and XSLT mappings.
Imported
1 2 XSD definitions

7-4 Copyright © 2005, Oracle. All rights reserved.

Importing the Schema for the Input


(Purchase Order)
1 2

7-5 Copyright © 2005, Oracle. All rights reserved.

Importing the Schema for the Output


(Purchase Order Acknowledgement)

1 2

3 4

7-6 Copyright © 2005, Oracle. All rights reserved.

2
Configuring the Transform Activity

7-7 Copyright © 2005, Oracle. All rights reserved.

Using the XSLT Mapper


2

1
3
Function
categories
Advanced functions
Code snippets
Conversion functions
Cumulative functions
Database functions
Date functions
Logical functions
Mathematical functions
Node-set functions
Preferred components
String functions
User-defined extension functions
User-defined named templates
http://www.w3.org/1999/XSL/Transform

7-8 Copyright © 2005, Oracle. All rights reserved.

XSLT Mapper: Key Features

• Rich graphical view with a simple drag-and-drop


technique
• Automatic two-way synchronization of graphical
and source view
• E t
Extensive
i function
f ti sets
t for
f building
b ildi complex
l
expressions
• Advanced testing and debugging tool with sample
instance generator
• Automap, based on similar names and types, for
increased productivity

7-9 Copyright © 2005, Oracle. All rights reserved.

3
XSLT Mapper: Extensive Function Set

• More than 100 built-in functions for creating


complex expressions
• Support for user-defined Java extension functions
• Support for user-defined XSLT templates
• Built-in DVM and database
l k
lookup ffunctions
ti

7-10 Copyright © 2005, Oracle. All rights reserved.

Creating the Mappings

7-11 Copyright © 2005, Oracle. All rights reserved.

Notes Only Page

7-12 Copyright © 2005, Oracle. All rights reserved.

4
XSLT Mapper: Array Handling

• Copy a source array to a target array by using the


drag-and-drop technique.
• Merge two or more source arrays into one target
array.
• C
Convert t an N
N-dimensional
di i l source array to
t a single
i l
dimension target array. This is the same as
converting a hierarchical structure in the source to
a flat structure in the target.
• Copy the Nth element in a source array to a target
element.

7-13 Copyright © 2005, Oracle. All rights reserved.

XSLT Mapper: Conditional Mapping

• Conditionally map a target element by using the


complex test expression and build default
behavior with simple clicks.
• Build test expressions by using the drag-and-drop
technique.
• Build complex XPath expressions by using the
XPath Expression Builder.
• Build nested and complex conditions.

7-14 Copyright © 2005, Oracle. All rights reserved.

XSLT Mapper: Automap

• Map complex structures by


using the drag-and-drop
technique.
• Map structures by using
dictionaries.
• Modify automap
preferences automatically.
• View the best match for an
unmapped target node.

7-15 Copyright © 2005, Oracle. All rights reserved.

5
Map Testing Tool

• Generate advanced sample instances with support


for arrays and recursive elements.
• View the source XML instance and result XML
instance side by side, and validate them against
their schemas.
schemas
• Modify XSLT and rerun test without leaving the
tool.
• Set breakpoints and debug XSLT by using the
built-in XSLT debugger.
• Test maps on Oracle or Xalan XSLT processor.

7-16 Copyright © 2005, Oracle. All rights reserved.

Testing the Transformation


1

3
7-17 Copyright © 2005, Oracle. All rights reserved.

Dictionary and Report Generation

• Generate an HTML report to obtain information


about:
– Mapped nodes
– Mapping logic used
– % complete
– % pending

• Generate dictionary from current mappings for


future maps.

7-18 Copyright © 2005, Oracle. All rights reserved.

6
Summary

In this lesson, you should have learned how to:


• Add transformation services
• Configure mapping by using the XSLT Mapper
• Test the transformation

7-19 Copyright © 2005, Oracle. All rights reserved.

Practice 7: Adding Transformation


Services to BPEL

7-20 Copyright © 2005, Oracle. All rights reserved.

7
8
Invoking a BPEL Service Through
Adapters

Copyright © 2005, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:


• Describe adapter services
• Configure a partner link for a File adapter
• Invoke an adapter service

8-2 Copyright © 2005, Oracle. All rights reserved.

Adapter Services

J2EE applications
Siebel
CRM

Oracle AS
Mainframe BAM
adapters

Database BPEL
BPM

Oracle APPS
COBOL file Portal
HRMS

8-3 Copyright © 2005, Oracle. All rights reserved.

1
Adapter Framework

Is a lightweight implementation based on:


• WSIF standards for outbound communication
• J2CA standards for inbound communication
Oracle BPEL Process Manager Outbound
JMS
SOAP BPEL WSIF J2EE
engine provider
Client JCA

JCA activation JCA


EIS
agent adapter
Inbound
Oracle Application Server
Containers 10g for J2EE

8-4 Copyright © 2005, Oracle. All rights reserved.

Benefits of Adapters

Adapters:
• Are standards-based, open, and flexible
• Provide one set of adapters for integration with
Oracle Portal, Oracle InterConnect, and OC4J
• Integrate Oracle applications with EIS applications
• Provide real-time bidirectional connectivity
• Support SOA with loose coupling and extensibility
• Provide scalability and high availability

8-5 Copyright © 2005, Oracle. All rights reserved.

OracleAS Adapter: Key Features


Design Run time Standards
Life cycle
UI support

Design time Run time Standards support Life cycle


MANAGEMENT

• EIS schemas that • Supports • Open Standards • Runs in the


can be b
ca browsed,
o sed, synchronous
sy c o ous – WSDL Application
pp cat o Server
Se e
searched, extracted, outbound two-way middle tier
– WSIF
and generated from Oracle AS to EIS –Runs in OC4J
– WSIL
• JDeveloper Adapter • Supports • Involves scalable
Wizard for asynchronous – XSD
–Load balancing
technology adapters outbound one-way – J2CA
from Oracle AS to EIS –Connection
• WSDL schemas for – JMS
and inbound one-way management
both outbound and •Architecture
inbound interactions from EIS to Oracle AS • Is managed via
– SOA Application Server
• WSIL browser for • Translates between
EIS native format to – EDA Control
OEM adapters
XML and back
• Supports multiple EIS
connections

8-6 Copyright © 2005, Oracle. All rights reserved.

2
OracleAS Adapters

Enterprise-strength infrastructure for connectivity to


Enterprise Information Systems (EIS)

Adapters
Design time

OracleAS adapters
Technology
Portal
Legacy SOAP
application From EIS
EIS
data to InterConnect
Package native
XML and
application API
back J2CA
Oracle BPEL
E-Business Suite

Oracle Application Server 10g

8-7 Copyright © 2005, Oracle. All rights reserved.

OracleAS Adapter Services for Outbound


Two-Way Synchronous Communication

• Outbound from Oracle AS to EIS


• Synchronous request–response
• J2CA outbound interaction
• Oracle InterConnect implemented

J2CA outbound EIS native


request API
Adapter Oracle AS
client adapters
J2CA outbound Reply
response from EIS
EIS
OC4J container

8-8 Copyright © 2005, Oracle. All rights reserved.

OracleAS Adapter Services for Outbound


One-Way Asynchronous Communication

• Outbound from Oracle AS to EIS


• Asynchronous request
• J2CA outbound interaction
• Oracle InterConnect subscribe

J2CA outbound
interaction EIS native
Adapter request Oracle AS API
client adapters

EIS
OC4J container

8-9 Copyright © 2005, Oracle. All rights reserved.

3
OracleAS Adapter Services for Inbound
One-Way Asynchronous Communication

• Inbound from EIS to Oracle AS


• Asynchronous publish
• J2CA inbound interaction
• Oracle InterConnect publish

EIS native J2CA outbound


API Oracle AS interaction Adapter
adapters client

EIS
OC4J container

8-10 Copyright © 2005, Oracle. All rights reserved.

Oracle AS Adapter Integration with Oracle


BPEL Process Manager

J2CA activation agent WSIF API

Adapter framework Adapter framework


[J2CA 1.5 container] [WSIF provider]

J2CA 1.5 resource J2CA 1.5 resource


adapter adapter

EIS EIS

8-11 Copyright © 2005, Oracle. All rights reserved.

OracleAS Adapter and Oracle BPEL


Process Manager Integration

WSIF JCA
BPEL WSIF
JCA resource EIS
p
process API
provider
id adapter
d t

Request (synchronous) or one-way (asynchronous)


Response (synchronous)

8-12 Copyright © 2005, Oracle. All rights reserved.

4
Adapter and Oracle BPEL Process
Manager Outbound Architecture
JDeveloper
BPEL Designer/
adapter wizard BPEL suitcase

Adapters WSDL:
J2CA binding

JNDI lookup and


BPEL Process Manager EIS
outbound Oracle AS native
WS sync interaction adapters
Adapter API
invoke framework (J2CA 1.5
[WSIF resource
Response
WS sync provider] adapter)
response

EIS
OC4J container

8-13 Copyright © 2005, Oracle. All rights reserved.

Adapter and Oracle BPEL Process


Manager Inbound Architecture
JDeveloper
BPEL Designer BPEL suitcase
or
adapter wizard Adapters WSDL:
Oracle-specific
binding

1. Start resource adapter.


EIS
2. Activate endpoint.
BPEL Process Manager 3. Deactivate endpoint. event
Oracle AS (push or
Adapter adapters pull)
framework (J2CA 1.5
WS
[pseudo resource
receive JCA 1.5 1. Create message adapter)
container] endpoint.
2. Call onMessage().
EIS
OC4J container

8-14 Copyright © 2005, Oracle. All rights reserved.

Design Time of Technology Adapters for


Oracle BPEL Process Manager Integration

JDeveloper
BPEL Designer
BPEL Suitcase
S it
Adapter
wizards Deployment XML
Adapter service
WSDL

8-15 Copyright © 2005, Oracle. All rights reserved.

5
Technology Adapters Integrated in
JDeveloper

Adapter wizards are accessed by a partner link to:


• Generate the WSDL that describes the service
• Locate the generated WSDL with a WSIL Browser

8-16 Copyright © 2005, Oracle. All rights reserved.

File and FTP Adapter

Design time Features


I/O
Multiple
File and FTP file formats
Parsing and adapter
formatting
XSD
Binary

Scalable via
OC4J
connections Pattern matching
Wizard-driven
modeling
and batching File*.XML

8-17 Copyright © 2005, Oracle. All rights reserved.

Database Adapter

The Database adapter:


• Enables querying of database tables from a BPEL
process by using any JDBC provider
• Is based on Oracle TopLink technology for object-
relational
l ti l mapping
i
• Uses wizard-driven modeling to map between
relational and object schemas
• Enables schemas to be expressed as XML schema
documents
• Uses OC4J connection pool management and
supports JTA transactions

8-18 Copyright © 2005, Oracle. All rights reserved.

6
Database Adapter Implemented with
TopLink

8-19 Copyright © 2005, Oracle. All rights reserved.

Oracle Applications Adapter

• Provides intuitive integration to Oracle


Applications
• Supports all E-Business Suite 11i modules
• Provides prebuilt interfaces to speed
i l
implementation
t ti
• Enables rapid development by using wizard-driven
modeling
• Enables reuse of existing skills and involves
reduced training cycles, resulting in a lower total
cost of ownership

8-20 Copyright © 2005, Oracle. All rights reserved.

Advanced Queuing (AQ) Adapter

• Enables sending or receiving messages from an


Oracle database configured with the Advanced
Queue (AQ) option
• Supports single or multiple consumer queues
• L
Leverages reliable
li bl message transport
t t (store
( t and
d
forward)
• Implements interface through the Java Message
Service (JMS) API

8-21 Copyright © 2005, Oracle. All rights reserved.

7
JMS Adapter

• Supports any Java Message Service (JMS)–


enabled environment
• Enables sending and receiving messages by using
JMS queues and topics
• S
Supports
t built-in
b ilt i JMS API ini Oracle
O l Application
A li ti
Server Containers for J2EE (OC4J)
• Provides access to lightweight, reliable, message
services distributed in the middle tier of a Web
application architecture

8-22 Copyright © 2005, Oracle. All rights reserved.

OEM Adapters

• Provides a glue layer between a BPEL process


and the OEM services
• Integrates by using WSIF providers and bindings
• Examples of top three OEM services:
– iWay Software Ltd
Ltd.
– Attunity for legacy applications
– Fujitsu (CICS only)
• Other vendors who integrate the services
(implicitly certified as JCA 1.5 adapters):
– Neon Systems
– Librados
– Pervasive Software
– GT Software

8-23 Copyright © 2005, Oracle. All rights reserved.

Design Time of OEM Adapters for Oracle


BPEL Process Manager Integration

BPEL Designer or
WSIL servlet adapter wizard
Oracle AS Adapter
adapter WSIL
browser
Application Oracle AS
Explorer
po e repository
(WSDL)

BPEL suitcase
(repository)

Deployment XML
Adapter service
WSDL

EIS

8-24 Copyright © 2005, Oracle. All rights reserved.

8
Oracle Application Explorer

8-25 Copyright © 2005, Oracle. All rights reserved.

Using the File Adapter: Example

Scenario: Invoking the batch OrderBooking service to


read the purchase order from a file by using a File
adapter

8-26 Copyright © 2005, Oracle. All rights reserved.

Selecting an Adapter Service

Define the adapter


service icon.

8-27 Copyright © 2005, Oracle. All rights reserved.

9
Configuring the File Adapter

4
Not supported for XML

8-28 Copyright © 2005, Oracle. All rights reserved.

Configuring the File Adapter

8-29 Copyright © 2005, Oracle. All rights reserved.

Creating the Partner Link for Calling the


OrderBooking Process

8-30 Copyright © 2005, Oracle. All rights reserved.

10
Configuring the Receive Activity for the
File Adapter

4 3

8-31 Copyright © 2005, Oracle. All rights reserved.

Invoking the OrderBooking Process

2
3

8-32 Copyright © 2005, Oracle. All rights reserved.

Configuring the Assign Activity for


Input and Output

1 3

2 4

Note: Assign copies to the autogenerated variable.

8-33 Copyright © 2005, Oracle. All rights reserved.

11
Deploying and Running the Process

1 2 3

8-34 Copyright © 2005, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:


• Describe adapter services
• Configure a partner link for a File adapter
• Invoke an adapter service

8-35 Copyright © 2005, Oracle. All rights reserved.

Practice 8: Using a File Adapter to Read


the Input Data From a File

8-36 Copyright © 2005, Oracle. All rights reserved.

12
9
Accessing Adapter-Enabled Services from
BPEL

Copyright © 2005, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:


• Invoke a BPEL service through a File adapter for
creating and writing a file
• Invoke a Database adapter as a service from BPEL

9-2 Copyright © 2005, Oracle. All rights reserved.

Invoking the File Adapter as a


Service from BPEL

Write

Invoke PartnerLink File adapter


p
Variable
activity
data

• Data is stored in a
variety of formats in
the file system.
• Writing a file is WSDL defines the
a one-way operation. output directory
and file name. Output file

9-3 Copyright © 2005, Oracle. All rights reserved.

1
Creating a Partner Link for the File Adapter

9-4 Copyright © 2005, Oracle. All rights reserved.

Creating a Partner Link for the File Adapter

Where to write the file

File name
Criteria for
when to write
the file

9-5 Copyright © 2005, Oracle. All rights reserved.

Creating a Partner Link for the File Adapter

5
7

9-6 Copyright © 2005, Oracle. All rights reserved.

2
Designing the Write File Activities

2 3

4 5

9-7 Copyright © 2005, Oracle. All rights reserved.

Viewing the Write File Activities

The POAcknowledge
process now includes
the file write operation
operation.

9-8 Copyright © 2005, Oracle. All rights reserved.

Deploying and Running the Process

1
2

9-9 Copyright © 2005, Oracle. All rights reserved.

3
Deploying and Running the Process

5
<?xml version="1.0" ?><POAcknowledge
xmlns="http://www.thiscompany.com/ns/sales"><CustomerID xmlns="">Antilla
Electronics</CustomerID><ID xmlns="">AS-0193</ID><ShippingAddress
xmlns=""><Name>DeGossaaCalro</Name><Address><Street>12, Burhon
Street</Street><City>Danzig</City><State>Godanzk</State><Zip>PO-
20398</Zip><Country>Poland</Country></Address></ShippingAddress><BillingAddres
s xmlns=""><Name>Mrs Castro</Name><Address><Street>23,
Uudemankatu</Street><City>Hyvinkaa</City><State>Finland</State><Zip>SF-
05800</Zip><Country>Finland</Country></Address></BillingAddress><Items
xmlns=""><ProductName>Grundi
TV</ProductName><Quantity>4</Quantity><USPrice>900.00</USPrice><ShippingDate>
2005-02-25</ShippingDate><PartNumber>239-FRH</PartNumber></Items><Ack
xmlns=""><OrderDate>2005-01-
10</OrderDate><OrderPrice>6100.00</OrderPrice><OrderStatus>Order Acknowleged
</OrderStatus><SupplierName>SelectManufacturing</SupplierName><SupplierPrice>1
000.00</SupplierPrice></Ack></POAcknowledge>

9-10 Copyright © 2005, Oracle. All rights reserved.

Deploying and Running the Process


6

9-11 Copyright © 2005, Oracle. All rights reserved.

Extending OrderBooking to Invoke


POAcknowledge

9-12 Copyright © 2005, Oracle. All rights reserved.

4
Creating the Partner Link

9-13 Copyright © 2005, Oracle. All rights reserved.

Invoking the File Write Service

2
3

5
6

9-14 Copyright © 2005, Oracle. All rights reserved.

Assigning the Input

AssignFileWriteIn

9-15 Copyright © 2005, Oracle. All rights reserved.

5
Assigning the Output
AssignFileWriteComments

9-16 Copyright © 2005, Oracle. All rights reserved.

Deploying and Running the Process

1
3

2
<?xml version="1.0" ?><POAcknowledge 5
xmlns="http://www.thiscompany.com/ns/sales"><Cust
omerID xmlns="">Antilla Electronics</CustomerID><ID
xmlns="">AS-0193</ID><ShippingAddress
xmlns=""><Name>DeGossaa Calro</Name>
<Address><Street>12,BurhonStreet</Street><City>Dan
zig</City><State>Godanzk</State><Zip>PO-
20398</Zip><Country>Poland</Country>

9-17 Copyright © 2005, Oracle. All rights reserved.

Invoking a Database Adapter as a Service


from BPEL

Invoke
PartnerLink DB adapter
p
activity
Variable
data
WSDL exposes DB operations.

Insert
Update
Delete
Database Table

9-18 Copyright © 2005, Oracle. All rights reserved.

6
Creating the FulfillOrder BPEL Process
by Using the Database Adapter Service

9-19 Copyright © 2005, Oracle. All rights reserved.

Creating a Partner Link for


Writing to the Database
1 2

9-20 Copyright © 2005, Oracle. All rights reserved.

Creating a Partner Link for


Writing to the Database

A partner link can be configured for:


• Calling a stored procedure
• Writing records to the database
• Polling the database for new or changed records

9-21 Copyright © 2005, Oracle. All rights reserved.

7
Creating a Partner Link for
Writing to the Database

Copy icon

9-22 Copyright © 2005, Oracle. All rights reserved.

Creating a Partner Link for


Writing to the Database

9
8

9-23 Copyright © 2005, Oracle. All rights reserved.

Invoking the Database Write Service

9-24 Copyright © 2005, Oracle. All rights reserved.

8
Designing the Database Record
Transformation
Mapping
Source Target

1 2

3
Create the
Mapping icon.

9-25 Copyright © 2005, Oracle. All rights reserved.

Designing the Database Record


Transformation

9-26 Copyright © 2005, Oracle. All rights reserved.

Designing the Database Record


Transformation

9-27 Copyright © 2005, Oracle. All rights reserved.

9
Deploying and Running the Process
1

9-28 Copyright © 2005, Oracle. All rights reserved.

Deploying and Running the Process

9-29 Copyright © 2005, Oracle. All rights reserved.

Invoking the FulfillOrder Service from


OrderBooking

OrderBooking FulfillOrder

9-30 Copyright © 2005, Oracle. All rights reserved.

10
Creating the Partner Link to Call
FulfillOrder

OrderBooking

9-31 Copyright © 2005, Oracle. All rights reserved.

Invoking and Receiving the Input from


FulfillOrder

9-32 Copyright © 2005, Oracle. All rights reserved.

Configuring the Assign for Input

AssignDBIn

9-33 Copyright © 2005, Oracle. All rights reserved.

11
Configuring the Assigns for Output
AssignDBWriteComments

9-34 Copyright © 2005, Oracle. All rights reserved.

Modifying the FulfillOrder Process for


Exception Processing

FulfillOrder

9-35 Copyright © 2005, Oracle. All rights reserved.

Adding Database Exception Handling

The simple data types


available for selection

9-36 Copyright © 2005, Oracle. All rights reserved.

12
Setting the Status to False

9-37 Copyright © 2005, Oracle. All rights reserved.

Adding a While Activity

1 This is the While activity.

5
4
The Scope
activity is
inside the
While loop.

9-38 Copyright © 2005, Oracle. All rights reserved.

Adding an Exception Branch


for the Scope Activity

The Add
Catchall
Branch icon
1

9-39 Copyright © 2005, Oracle. All rights reserved.

13
Adding a Wait Activity

9-40 Copyright © 2005, Oracle. All rights reserved.

Deploying and Running the Processes


1
2

9-41 Copyright © 2005, Oracle. All rights reserved.

Deploying and Running the Processes

9-42 Copyright © 2005, Oracle. All rights reserved.

14
Undeploying Processes

To undeploy processes, perform the following steps:


1. Click the link of the process to undeploy.
2. Click the BPEL Processes tab, and then click the
Manage link.
3. Scroll down and click Undeploy.
4. When asked if you want to mark all open instances
for this process as stale, click OK.
5. Click Done.
6. Click the Dashboard tab.
Repeat these steps until all the versions are
undeployed.

9-43 Copyright © 2005, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:


• Invoke a BPEL service through a File adapter for
creating and writing a file
• Invoke a Database adapter as a service from BPEL

9-44 Copyright © 2005, Oracle. All rights reserved.

Practice 9.1: Invoke the File Adapter as a


Service from BPEL to Write a File

9-45 Copyright © 2005, Oracle. All rights reserved.

15
Practice 9.2: Extend OrderBooking to
Invoke POAcknowledge

9-46 Copyright © 2005, Oracle. All rights reserved.

Practice 9.3: Invoke a Database Adapter


as a Service from BPEL

9-47 Copyright © 2005, Oracle. All rights reserved.

Practice 9.4: Invoke the FulfillOrder


Service from OrderBooking

OrderBooking FulfillOrder

9-48 Copyright © 2005, Oracle. All rights reserved.

16

You might also like