Web Services - Business Process Execution Language 2.0
Document Sample


www.oasis-open.org
WS-BPEL 2.0
Web Services
Business Process Execution Language Workshop
Dieter König, IBM Senior Technical Staff Member
(dieterkoenig@de.ibm.com)
Charlton Barreto, Adobe Senior Computer Scientist/Architect
(charltonb@adobe.com)
WSDL Message
receive exit Variables
WS-BPEL 2.0
42
reply throw
XML Schema XML Schema
Type Element partner partner
invoke link link
rethrow
assign
Basic wait
Partner
Activities Links
validate compensate
MyProcess Port Partner Port
empty compensateScope Type 1 Link Type Type 2
receive
extensionActivity
invoke
receive
invoke
flow pick
invoke
event fault
handler
event handler
fault
sequence forEach handler handler
Structured
Handlers
while
Activities if-else
compensation termination
handler handler
repeatUntil scope Properties
Correlation Sets
Property 1
Property 2
WS-BPEL 2.0
Motivation
OASIS and WS-BPEL
Main Concepts
Examples
Status and support
Motivation
Integration continues to be a key problem facing
businesses
Intra-enterprise integration (Enterprise Application Integration)
Integrating with partners (Business-to-Business Integration)
Syndication
Web services move towards service-oriented
computing
Applications are viewed as “services”
Loosely coupled, dynamic interactions
Heterogeneous platforms
No single party has complete control
Service composition
How do you compose services in this domain?
Integration
Why the Need For BPEL?
WSDL defined Web services have a stateless
interaction model
Messages are exchanged using
Synchronous invocation
Uncorrelated asynchronous invocations
Most “real-world” business processes require a
more robust interaction model
Messages exchanged in a two-way, peer-to-peer
conversation lasting minutes, hours, days, etc.
BPEL provides the ability to express stateful,
long-running interactions
Two programming models
Programming in the large
Non-programmers implementing flows
Flow logic deals with combining functions in order to
solve a more complex problem (such as processing
an order)
Programming in the small
Programmers implementing functions
Function logic deals with a discrete fine-grained task
(such as retrieving an order document or updating a
customer record)
Process Usage Patterns
Aiming for a single approach for both
Executable processes
Contain the partner‟s business logic behind an
external protocol
Abstract processes
Define the publicly visible behavior of some or all
of the services an executable process offers
Define a process template embodying domain-
specific best practices
Process Model Requirements
Portability and Interoperability
Flexible Integration
Rich, and easily adaptable to changes in underlying services
Recursive, type-based composition, enables
Third-party composition of existing services
Providing different views on a composition to different parties
Increased scalability and reuse
Stateful conversations and lifecycle management
Supports multiple stateful long-running conversations
Recoverability
Long running business processes need fault handling and
compensation mechanisms to manage and recover from errors
Benefits of BPEL
Industry standard language for expressing business
processes
Leverage a common skill set and language
Designed to fit naturally into the Web services stack
Expressed entirely in XML
Uses and extends WSDL 1.1
Uses XML Schema 1.0 for the data model
Portable across platform and vendor
Will run on any BPEL-compliant engine
Interoperable between interacting processes
Layering on top of Web services stack
WS-BPEL 2.0
BPEL Historical Timeline
BPEL is the Web Services
Dec 2000
Orchestration standard from OASIS Microsoft publishes XLANG
bee•pel‟, beep‟•uhl, bip‟•uhl March 2001
IBM publishes WSFL
An XML-based grammar for
July 2002
describing the logic to orchestrate IBM, Microsoft and BEA
converge WSFL & XLANG
the interaction between Web into BPEL4WS 1.0
services in a business process March 2003
BPEL4WS is submitted to
OASIS
May 2003
OASIS publishes BPEL4WS
1.1
1stH 2007
WS-BPEL 2.0 released
WS-BPEL in the WS-* Stack
Business
You are here WS-BPEL
Processes
WSDL, Policy, UDDI, Inspection Description
Transactions Quality
Reliable
Security Of
Messaging
Coordination Service
SOAP (Logical Messaging) Other protocols Transport
and
XML, Encoding Other services Encoding
WS-BPEL 2.0
Motivation
OASIS and WS-BPEL
Main Concepts
Examples
Status and support
Getting the Players Together
(*)
BPEL 1.1
WS-BPEL 2.0
(*) BPEL 1.1 authors, May 2003
WS-BPEL 2.0
Motivation
OASIS and WS-BPEL
Main Concepts
Examples
Status and support
WS-BPEL Language Structure
Process
Partner links
Data handling
Properties and correlation
Basic and structured activities
Scopes
WS-BPEL Process Definition
process
Declare dependencies on Declare namespaces of
external XML Schema or WS-BPEL extension
WSDL definitions imports extensions attributes and elements
Relationships that a WS- Relationship between
BPEL process will employ partner message inbound and outbound
in its behavior links exchanges message activities
Data holding state of a Application data fields
correlation
business process or variables that together identify a
sets
exchanged with partners conversation
Concurrently process
event fault Deal with exceptional
inbound messages or
handlers handlers situations in a process
timer alarms
Perform the process logic primary WSDL
– any number of activities activity definitions
may be recursively XML
nested schemas
Relationship with WSDL
BPEL is layered on top of and extends
the WSDL service model
WSDL defines the specific operations allowed
BPEL defines how WSDL operations are
orchestrated to satisfy a business process
BPEL also specifies extensions to WSDL in
support of long-running asynchronous
business processes
BPEL 2.0
BPEL-defined
WSDL 1.1
WSDL extensions
Recursive Composition
BPEL processes interact with WSDL services
exposed by business partners
Interfaces exposed Interfaces consumed
by the BPEL process by the BPEL process
WSDL
Loan Approval
Loan Approval Process
PortType
receive
Financial Institution„s
invoke Web Service
(Loan Approver)
reply
Web Web
Service Service
Composition of Web Services
Service A Service P Service B
receive
invoke
receive
invoke
invoke
A‟s WSDL P‟s WSDL F B‟s WSDL
Partner Link Type Partner Link Type
Partner Links
process
Peer-to-peer conversational partner relationship
partner
link
receive invoke
Inbound request – service Outbound request – service
provided by the process required by the process
myRole partnerRole
WSDL WSDL
partner link type
port type port type
Provided port type Required port type
Variables
process
Variables defined using WSDL messages
request request
receive invoke
response
42 xsl:transform
response
reply assign
WSDL 42 XML Schema
WSDL XML
WSDL
messages elements / types
message schemas
message Variables defined using XML schema elements or types
Variable Properties
process
A property creates a
name
that has
semantic significance
beyond an XML schema type Properties
isolate the process logic
getVariableProperty( variable, property )
from the details of a
variable definition
WSDL message
...
property
part part part property
alias
Typed properties are XML schema element
mapped (aliased) to property
parts of WSDL messages property
alias
or XML schema elements
Properties and Correlation Sets
Submit purchase order
process instance 1
How to identify stateful instances
purchaseOrder
via stateless Web service interfaces?
cId = 0815
orderNo = 42
process
process instance 2
receive
initiate correlation set
customerId customerId
orderNumber orderNumber
process instance 3
locate
receive
queryOrderStatus
custId = 0815
Messages in (0311, 33) 1
oNo = 42 process instance 4
long-running conversations (0707, 11) 2
are correlated to (0815, 42) 3
Query order status the correct process instance (0815, 49) 4
Basic Activities
process
Do a blocking wait for a Immediately terminate
matching message to arrive / receive reply exit execution of a business
send a message in reply process instance
Invoke compensation on
Invoke a one-way or invoke compensate all completed child scopes
request-response operation in default order
Update the values of Invoke compensation on
assign compensateScope
variables or partner links one completed child scope
with new data
Validate XML data stored Wait for a given time
validate wait period or until a certain
in variables
time has passed
Generate a fault from inside throw empty No-op instruction for
the business process a business process
Forward a fault from inside Wrapper for language
rethrow extensionActivity
a fault handler extensions
Structured Activities
process
Contained activities are flow pick Block and wait for a
executed in parallel, A suitable message to arrive
partially ordered through
B C M1 M2 … A (or time out)
control links
Contained activities are sequence forEach Contained activity is
performed sequentially in performed sequentially or
lexical order 1. 2. … N. 1. 2. … N. in parallel, controlled by a
specified counter variable
Contained activity is while if-elseif-else Select exactly one branch
repeated while a predicate of activity from a set of
c1 c2
holds c … choices
Contained activity is repeatUntil scope Associate contained activity
repeated until a predicate with its own local variables,
holds c partner links, etc.,
and handlers
Nesting Structured Activities
sequence
<sequence>
<receive .../>
receive
<flow>
flow
<sequence>
<invoke .../>
sequence sequence
<while ... >
<assign>...</assign>
</while> invoke receive
</sequence>
<sequence> while invoke
<receive .../>
<invoke ... /> assign
</sequence>
</flow>
<reply .../>
reply
</sequence>
Scopes
Scopes provide a context process
which influences the
execution behavior of its scope
enclosed activities scope
Local declarations – scope
partner links, message
exchanges, variables, scope
correlation sets
Local handlers – event
handlers, fault handlers, a primary activity
termination handler, and a
compensation handler
scope
Isolated scopes provide
scope
control of concurrent scope
access to shared scope Termination handler to deal
resources scope with forced scope termination
(external faults)
Compensation handler to
undo persisted effects of
already completed activities
Process Instance Lifecycle
Business processes defined in BPEL
represent stateful Web services
When a process is started, a new
instance is created according to the
process definition
The creation and destruction of BPEL
process instances is by design implicit
Process
receive invoke invoke invoke reply
WS-BPEL 2.0
Motivation
OASIS and WS-BPEL
Main Concepts
Examples
Status and support
Graph-Oriented Authoring Style
flow
riskAssessmentPT loanApprovalPT
amount < 10000 amount >= 10000
receive
risk = "high"
loan invoke invoke loan
assessor approver
assign
risk = "low" approved = "true"
approved = "false"
reply
1. A customer asks for a loan, providing name and amount info
2. Two services are involved:
a) A risk assessor which can approve the loan if the risk is low
b) A loan approver which checks the name and approves/disapproves the loan
3. The reply is returned to the customer
Parallel Processing
parallel
flow scope
forEach
scope event
...
scope handler
event
event
scope
scope handler
handler
event
scope
scope handler
event
scope handler
scope event
... handler
event
handler
event
...
handler
event
handler
event
handler
event
... ...
handler
...
Fault Handling & Compensation
Process
fault
sequence
handler
scope scope
notify
manager
compensation fault
handler handler
compensate
charge refund ship
rethrow
credit card customer goods
Abstract & Executable Processes
Executable Processes
Contain the partner‟s business logic
behind an external protocol
Model actual behavior of a participant
in a business interaction
Encompass enough detail to fully
specify execution
Abstract & Executable Processes
Abstract Processes
Partially specified processes that are
not intended to be executed
May hide some of the required
concrete operational details
Serve a descriptive role
Used to guide executable processes
More than one possible use case
Travel Reservation - Example
Executable Processes
Abstract Process ViewView
Traveler Process Agent Process Airline Process
plan get get
trip itinerary order
submit select reserve
to agent airline seats
order charge
tickets credit card
receive receive receive confirm
confirmation tickets confirmation flight
send send
confirmation tickets
Abstract Profiles
Profiles address varying requirements
among Abstract Processes
Two profiles provided in WS-BPEL
Observable Behavior
Process Template
Abstract Profiles & Use Cases
Use cases
Constraints on message exchange
Specify order in which messages are consumed or produced
View on internal processes
Only projection of internal (executable) process is visible
Bridge model to executable
Provide hooks to executable for model definition to enable
abstraction
Template as “best practice”
Specification of common activities, major data structures, and
main control flow
WS-BPEL 2.0
Motivation
OASIS and WS-BPEL
Main Concepts
Examples
Status and support
What’s new since BPEL 1.1?
Conditional behavior – if {elseif} [else]
Replacing the BPEL4WS 1.1 switch activity
Repetitive execution – repeatUntil
Like BPEL4WS 1.1 while activity with at least one iteration
Processing multiple branches – forEach
Sequential or parallel iteration controlled by a counter variable and a
completion condition
Reversing work – compensate and compensateScope
Compensate all child scopes or one specific child scope
Propagating faults – rethrow
Rethrow the fault caught in a fault handler
Validating data – validate
Explicit XML schema validation of WS-BPEL variable content
Validation also possible within assignment
Immediately ending a process – exit
Replacing the BPEL4WS 1.1 terminate activity
Adding new activity types – extensionActivity
Designated WS-BPEL extension point for new activity types
What’s new since BPEL 1.1?
Variable initialization
Inline within variable declaration
Partner links
Intent for partner role initialization
Locally declared messageExchange
Internal correlation of receive/pick/onEvent and reply activities
Correlation sets
Join behavior for multiple start activities
XML schema variables in Web service activities
Usability enhancement for WS-I compliant doc/lit-style WS interactions
Assignment
Clarification of copy behavior
Keep source element name
Ignore missing from data
Extension assign operation
XSLT for variable transformations
New XPath extension function bpel:doXslTransform(...)
XPath access to variable data
XPath variable syntax $variable[.part]/location
Flow activity
Scope isolation and link semantics
What’s new since BPEL 1.1?
Fault handlers
XML schema typed fault variables
Exit on standard fault behavior
Compensation handlers
New scope snapshot semantics
Fault handling during compensation
Event handlers
Recurring events
Resolution of variable, partnerLink, messageExchange, correlationSet
Termination handler
Customize scope termination behavior
Import
Predefined import types WSDL and XSD
Extensibility
Global documentation element
Extension namespace declarations
Mandatory and optional extensions
Abstract processes
Common base (syntax) and profiles (semantics)
Opacity and omission of activities, expressions, attributes
WS-BPEL Schedule
Status (March 2007)
First and second public reviews completed
Approved Committee Specification submitted
for standardization
Five organizations have certified use of WS-
BPEL in product
ActiveEndpoints, IBM, Intalio, SEEBURGER, Sun
WS-BPEL Schedule
Next steps
OASIS standard - April 2007
Voting opens March 19 and closes March 30
OASIS Symposium - April 15-20, 2007
San Diego, California, USA
WS-BPEL Lightning Round - April 16
Business Process Sessions - April 16
WS-BPEL Workshop - April 18
WS-BPEL Follow-on Work
BPEL4People
Human user interactions
http://www-128.ibm.com/developerworks/webservices/library/specification/ws-bpel4people/
BPEL Subprocesses
Based on a coordination protocol
http://www-128.ibm.com/developerworks/webservices/library/specification/ws-bpelsubproc/
BPELJ
Inline Java code in activities and expressions
http://www-128.ibm.com/developerworks/library/specification/ws-bpelj/
Currency with related standards
WSDL 2.0, XPath 2.0, XQuery, etc.
Get documents about "