WS-BPEL 2.0 www.oasis-open.org Web Services Business Process Execution Language Workshop Dieter König, IBM Senior Technical Staff Member ([email protected]) Charlton Barreto, Adobe Senior Computer Scientist/Architect ([email protected])
Apr 01, 2015
WS-BPEL 2.0
www.oasis-open.org
Web ServicesBusiness Process Execution Language Workshop
Dieter König, IBM Senior Technical Staff Member([email protected])Charlton Barreto, Adobe Senior Computer Scientist/Architect([email protected])
WS-BPEL 2.0 MyProcess
invoke
receive
receive
invoke
invoke
Handlers
faulthandler
eventhandler
faulthandler
compensationhandler
terminationhandler
eventhandler
PartnerLinks
PartnerLink Type
PortType 1
PortType 2
partnerlink
partnerlink
Variables42
WSDL Message
XML SchemaType
XML SchemaElement
PropertiesCorrelation Sets
Property 1
Property 2
StructuredActivities
if-elsewhile
scope
pick
sequence
flow
repeatUntil
forEach
BasicActivities
receive
reply
invoke
throw
exit
wait
empty
compensatevalidate
assign
rethrow
extensionActivity
compensateScope
WS-BPEL 2.0
Motivation OASIS and WS-BPEL Main Concepts Examples Status and support
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?
Motivation
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
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)
Two programming models
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 Usage Patterns
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
Process Model Requirements
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
Benefits of BPEL
BPEL is the Web Services Orchestration standard from OASIS
bee•pel’, beep’•uhl, bip’•uhl An XML-based grammar for
describing the logic to orchestrate the interaction between Web services in a business process
BPEL Historical Timeline
Dec 2000Microsoft publishes XLANG
March 2001IBM publishes WSFL
July 2002IBM, Microsoft and BEA converge WSFL & XLANG into BPEL4WS 1.0
March 2003BPEL4WS is submitted to OASIS
May 2003OASIS publishes BPEL4WS 1.1
1stH 2007WS-BPEL 2.0 released
BPEL Historical Timeline
Dec 2000Microsoft publishes XLANG
March 2001IBM publishes WSFL
July 2002IBM, Microsoft and BEA converge WSFL & XLANG into BPEL4WS 1.0
March 2003BPEL4WS is submitted to OASIS
May 2003OASIS publishes BPEL4WS 1.1
1stH 2007WS-BPEL 2.0 released
WS-BPEL 2.0
WS-BPEL
XML, Encoding
Other protocols
Other services
Transportand
Encoding
BusinessProcesses
WSDL, Policy, UDDI, Inspection Description
SecurityReliable
Messaging
Transactions
Coordination
SOAP (Logical Messaging)
QualityOf
Service
You are here
WS-BPEL in the WS-* Stack
WS-BPEL 2.0 Motivation OASIS and WS-BPEL Main Concepts Examples Status and support
Getting the Players Together
BPEL 1.1
(*)
(*) BPEL 1.1 authors, May 2003
WS-BPEL 2.0
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
imports
Declare dependencies on external XML Schema or WSDL definitions extensions
Declare namespaces of WS-BPEL extension
attributes and elements
variablesData holding state of a business process or exchanged with partners
partnerlinks
Relationships that a WS-BPEL process will employ in its behavior
correlationsets
Application data fields that together identify a
conversation
messageexchanges
Relationship between inbound and outbound
message activities
eventhandlers
Concurrently process inbound messages or timer alarms
faulthandlers
Deal with exceptional situations in a process
primaryactivity
Perform the process logic – any number of activities may be recursively nested
XMLschemas
WSDLdefinitions
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
WSDL 1.1
BPEL 2.0
BPEL-defined WSDL extensions
Relationship with WSDL
Recursive Composition BPEL processes interact with WSDL services
exposed by business partners
WebService
Loan Approval Process
WebService
WSDLLoan Approval
PortType
Financial Institution‘sWeb Service
(Loan Approver)invoke
Interfaces exposed
by the BPEL process
Interfaces consumed
by the BPEL process
receive
reply
Composition of Web Services
Partner Link Type Partner Link Type
Service PService A Service B
A’s WSDL P’s WSDL B’s WSDL
invoke
receive
receive
invoke
invoke
Partner Links
process
partnerlink
partner link type
Peer-to-peer conversational partner relationship
WSDLport type
myRole
Provided port type
WSDLport type
partnerRole
Required port type
receive
Inbound request – service provided by the process
invoke
Outbound request – service required by the process
Variables
process
assign
xsl:transform
receive
request
response
invoke
request
reply
response
42
WSDLmessage
WSDLmessage
WSDLmessages
Variables defined using WSDL messages
42XML
schemas
XML Schemaelements / types
Variables defined using XML schema elements or types
process
Variable Properties
XML schema element
WSDL message
part part part... propertyproperty
alias
Typed properties are mapped (aliased) to
parts of WSDL messages or XML schema elements
propertyproperty
alias
A property creates a name
that has semantic significance
beyond an XML schema type
getVariableProperty( variable, property )
Properties isolate the process logic
from the details of a variable definition
process instance 3
process
Properties and Correlation Sets
correlation set
customerId
orderNumber
process instance 1
process instance 2
process instance 4
receive
Submit purchase orderHow to identify stateful instances
via stateless Web service interfaces?
Messages inlong-running conversations
are correlated tothe correct process instance
locate
purchaseOrder
cId = 0815
orderNo = 42
receive
Query order status
queryOrderStatus
custId = 0815
oNo = 42
customerId
orderNumber
4(0815, 49)
3(0815, 42)
2(0707, 11)
1(0311, 33)
initiate
process instance 3
process
Basic Activities
receive reply
invokeInvoke a one-way or request-response operation
Do a blocking wait for a matching message to arrive / send a message in reply
validate
assignUpdate the values of variables or partner links with new data
Validate XML data stored in variables
throw
rethrow
Generate a fault from inside the business process
Forward a fault from inside a fault handler
exit
Immediately terminate execution of a business
process instance
compensate
compensateScope
Invoke compensation on all completed child scopes
in default order
Invoke compensation on one completed child scope
waitWait for a given time
period or until a certain time has passed
empty No-op instruction fora business process
extensionActivityWrapper for language
extensions
process
flowContained activities are executed in parallel, partially ordered through control links
sequenceContained activities are performed sequentially in lexical order
whileContained activity is repeated while a predicate holds
repeatUntilContained activity is repeated until a predicate holds
pick Block and wait for a suitable message to arrive
(or time out)
forEach Contained activity is performed sequentially or in parallel, controlled by a specified counter variable
if-elseif-else Select exactly one branch of activity from a set of
choices
scope Associate contained activity with its own local variables,
partner links, etc., and handlers
Structured Activities
2. N.1. …
B C
A
c
c
c1 c2…
2. N.1. …
… AM2M1
Nesting Structured Activities
<sequence> <receive .../> <flow> <sequence> <invoke .../> <while ... > <assign>...</assign> </while> </sequence> <sequence> <receive .../> <invoke ... /> </sequence> </flow> <reply .../></sequence>
receive
reply
receive
invoke
invoke
assign
sequence
sequencesequence
flow
while
process
Scopes
scope
scope
scope
scopescope
scope
scope
Scopes provide a context which influences the execution behavior of its enclosed activities
Isolated scopes provide control of concurrent access to shared resources
scope
Local declarations – partner links, message exchanges, variables, correlation sets
Local handlers – event handlers, fault handlers, a termination handler, and a compensation handler
Compensation handler to undo persisted effects of
already completed activities
Termination handler to deal with forced scope termination
(external faults)
primary activity
scope
Process
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
receive replyinvokeinvoke invoke
WS-BPEL 2.0
Motivation OASIS and WS-BPEL Main Concepts Examples Status and support
Graph-Oriented Authoring Style
1. A customer asks for a loan, providing name and amount info2. 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 loan3. The reply is returned to the customer
invoke
receive
invoke
reply
assign
loanApprovalPT
loanapprover
riskAssessmentPT
loanassessor
amount < 10000 amount >= 10000
risk = "high"
risk = "low" approved = "true"
approved = "false"
flow
scope
eventhandler
parallelforEach
scope
flow
. . .
. . .
. . .
. . .
. . .. . .
scopescope
scopescope
scopescope
scope
eventhandlerevent
handlereventhandlerevent
handlereventhandlerevent
handlereventhandlerevent
handlereventhandlerevent
handler
Parallel Processing
compensationhandler
chargecredit card
refundcustomer
shipgoods
faulthandler
notifymanager
compensate
faulthandler
rethrow
Process
sequence
scopescope
Fault Handling & Compensation
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 - ExampleAbstract Process ViewExecutable Processes View
getitinerary
getorder
ordertickets
receiveconfirmation
confirmflight
sendtickets
sendconfirmation
submitto agent
receivetickets
receiveconfirmation
selectairline
reserveseats
chargecredit card
plantrip
Agent Process Airline ProcessTraveler Process
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
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
What’s new since BPEL 1.1?
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 interactionshttp://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.