Professional Documents
Culture Documents
Objectives
1
Service-Oriented Architecture
Service request
Service Service
consumer provider
Service response
Develop
services
Secure Compose
and federate services
Provision Orchestrate
and manage services
Discover and
access
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
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
Find Register
3 2 (UDDI)
(UDDI)
Generate
Web services 1 WSDL
directory
4 Invoke request (SOAP) Interface
Internet (WSDL)
3
SOAP Message Structure
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>
Service Invocation
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
4
Orchestrating Services Through BPEL
Web service
Portal
Java service
?
Database
c stored procedures
J2EE ERP
SAP, Oracle
BPEL
UI User tasks
Tomcat
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
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
5
Standards: Building Blocks of BPEL
Transactions
Quality of
ment
Context
UDDI Discovery
WSDL Description
SOAP
Message
XML
HTTP, IIOP, JMS, SMTP Transport
• 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
6
Oracle BPEL Process Manager:
Key Features
• 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
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
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
7
Notes Only Page
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
Service Adapters
WSDL Database
WSDL Files
XML,WSIF,JCA
8
Integrated Adapters
9
Oracle BPEL Process Manager:
Methodology
Expose
services Flow Transformation Exception
User
tasks
workflow
Change
Unit test
Oracle Integration
Messaging
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
Oracle
File/FTP, JMS, Oracle application server
AQ, RDBMS database
B2B
B ilt i processors
Built-in
B2B InterConnect
engine
SDK Correlation KPI Alerts
InterConnect
Actual Target
cube cube
Oracle database
11
Oracle BPEL Process Manager:
Components
Oracle BPEL
Process
Manager
JDeveloper Oracle Lite BPEL
BPEL Designer Console
database
Creating Connections
12
Creating the Database Connection
1 2
4 5
Summary
13
Practice for Lesson 2
Installing BPEL Designer and Process Manager
14
3
Building a Simple BPEL Process
Objectives
SalesDB Start
Duplicate
number!
Billing
Router
End
1
Notes Only Page
Applications -
Navigator
Structure pane
Message log
Request:
<input>Name</input>
Response:
<result>Hello Name</result>
Client HelloWorld
BPEL process
Concatenate
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.
1
2
3
Initial State of the BPEL Process
By selecting Synchronous
BPEL Process, a skeleton is
created along with all the
necessary source files.
Workspace
Project file
4
Creating a Copy Rule
1 2
XPath expression
3
builder icon
Function
types
3
<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>
5
BPEL Activities in HelloWorld
<sequence name="main">
<receive name="receiveInput" partnerLink="client"
portType="client:HelloWorld"
operation="process" variable="inputVariable"
createInstance="yes"/>
<assign name="createReturnStr">
<copy>
<from expression="concat("Hello
" bpws:getVariableData('inputVariable' 'pa
",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>
6
BPEL Depends on WSDL and WSDL
Extensions
Service Service
implementation
definition Port
Binding
Type
7
Validating and Deploying a BPEL Process
Deploy
HelloWorld.wsdl bpel_HelloWorld_1.0.jar
3
4
bpelc
Deployment directory:
8
Notes Only Page
9
BPEL Activities
Summary
10
4
Orchestrating Services with BPEL
Objectives
Web service
Portal
Java service
?
Database
stored procedures
J2EE ERP,
SAP, Oracle
BPEL
User tasks
UI
TOMCAT
1
Developing a BPEL Service
To call this
process
To receive input
To return output
Initial Structure of an
Asynchronous Service
To call this
process
To receive input
For the
asynchronous
callback
2
Initial Structure of an Empty Service
E t
Empty
process
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)
Client Service
Invoke
Partner Partner
link BPEL process link
WSIL
Service description
browser (WSDL)
3
Partner Links
Deployment descriptor (bpel.xml)
inputVariable
<variable>
Request Message
d1 <receive>
prepare crInput
<assign> Credit service
crInput
nk
on
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
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.
4
Importing a User-Defined XML Schema
3
2
5
5
Configuring the Partner Link Activity
1 3
2
BPEL Variables
Select this
3 message type.
4
5
6
Creating the Output Variable
Select this
message type.
3
4
5
1
2
4
Click to
autogenerate a
variable.
Click to browse for
5 an existing variable.
7
Configuring Assign Activity Copy Rules
2 3
3
2
8
Deploying and Running the Process
1
9
Notes Only Page
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
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>
10
Implementing Correlation Sets
Prepare order
<assign> Rapid
RDInput Distributors
<variable> PartnerLink
Initiate service d3
<invoke> Initiate port
d2 Client
<callback>
outputVariable Dehydration point
WSDL <variable>
BPEL process
• My Role must be
specified for
asynchronous calls.
• Partner Role is
selected from those
provided by service.
11
Invoking the Rapid Distributors Service
12
Viewing the Asynchronous Process
Activities
Summary
13
Practice 4: Invoking Synchronous and
Asynchronous Services
14
6
Increasing Process Reliability Through
Fault Handling and Exception Management
Objectives
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
1
Adding a Scope Structured Activity
Managing Faults
2
Adding a CatchAll Exception Branch
Exception branch
3
The CatchAll in the OrderBooking
Process
CatchAll
1 2
Initiate service
<invoke>
<pick>
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>
Understanding Compensating
Transactions
Compensating Transactions
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!
5
Understanding the BPEL
compensationHandler
6
Summary
Practice 6:
Adding a Branch for Exception Handling
7
7
Adding Transformation Services to BPEL
Objectives
XSLT Mapper
POAcknowledge
BPEL process
XSLT
PurchaseOrder.xml POAcknowledge.xml
1
Adding Transformation Services
1 2
3 4
2
Configuring the Transform Activity
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
3
XSLT Mapper: Extensive Function Set
4
XSLT Mapper: Array Handling
5
Map Testing Tool
3
7-17 Copyright © 2005, Oracle. All rights reserved.
6
Summary
7
8
Invoking a BPEL Service Through
Adapters
Objectives
Adapter Services
J2EE applications
Siebel
CRM
Oracle AS
Mainframe BAM
adapters
Database BPEL
BPM
Oracle APPS
COBOL file Portal
HRMS
1
Adapter Framework
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
2
OracleAS Adapters
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
J2CA outbound
interaction EIS native
Adapter request Oracle AS API
client adapters
EIS
OC4J container
3
OracleAS Adapter Services for Inbound
One-Way Asynchronous Communication
EIS
OC4J container
EIS EIS
WSIF JCA
BPEL WSIF
JCA resource EIS
p
process API
provider
id adapter
d t
4
Adapter and Oracle BPEL Process
Manager Outbound Architecture
JDeveloper
BPEL Designer/
adapter wizard BPEL suitcase
Adapters WSDL:
J2CA binding
EIS
OC4J container
JDeveloper
BPEL Designer
BPEL Suitcase
S it
Adapter
wizards Deployment XML
Adapter service
WSDL
5
Technology Adapters Integrated in
JDeveloper
Scalable via
OC4J
connections Pattern matching
Wizard-driven
modeling
and batching File*.XML
Database Adapter
6
Database Adapter Implemented with
TopLink
7
JMS Adapter
OEM Adapters
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
Oracle Application Explorer
9
Configuring the File Adapter
4
Not supported for XML
10
Configuring the Receive Activity for the
File Adapter
4 3
2
3
1 3
2 4
11
Deploying and Running the Process
1 2 3
Summary
12
9
Accessing Adapter-Enabled Services from
BPEL
Objectives
Write
• 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
1
Creating a Partner Link for the File Adapter
File name
Criteria for
when to write
the file
5
7
2
Designing the Write File Activities
2 3
4 5
The POAcknowledge
process now includes
the file write operation
operation.
1
2
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>
4
Creating the Partner Link
2
3
5
6
AssignFileWriteIn
5
Assigning the Output
AssignFileWriteComments
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>
Invoke
PartnerLink DB adapter
p
activity
Variable
data
WSDL exposes DB operations.
Insert
Update
Delete
Database Table
6
Creating the FulfillOrder BPEL Process
by Using the Database Adapter Service
7
Creating a Partner Link for
Writing to the Database
Copy icon
9
8
8
Designing the Database Record
Transformation
Mapping
Source Target
1 2
3
Create the
Mapping icon.
9
Deploying and Running the Process
1
OrderBooking FulfillOrder
10
Creating the Partner Link to Call
FulfillOrder
OrderBooking
AssignDBIn
11
Configuring the Assigns for Output
AssignDBWriteComments
FulfillOrder
12
Setting the Status to False
5
4
The Scope
activity is
inside the
While loop.
The Add
Catchall
Branch icon
1
13
Adding a Wait Activity
14
Undeploying Processes
Summary
15
Practice 9.2: Extend OrderBooking to
Invoke POAcknowledge
OrderBooking FulfillOrder
16