SOA and BPEL

Document Sample
SOA and BPEL Powered By Docstoc
					SOA AND BPEL
By Ramanujan

© Wipro Technologies - Wipro Confidential - Not for Distribution

Objectives
             What is a Service Oriented Architecture? Web Services Standards for Web Services Emerging Standards for Web Services Need of Business Process Business Process Business Integration Overview of BPEL BPEL and WSDL Structure of BPEL Process BPEL Elements BPEL Handler and Scope BPEL’s Future



Conclusion

© Wipro Technologies - Wipro Confidential - Not for Distribution

What is Service Oriented Architecture?

 Service Oriented Architecture is a programming model that allows organizations to develop reusable software components, which communicate with each other across a common interface.  SOA is a client/server relationship where clients (requestors) invoke encapsulated business processes (services) using interface definitions published to service definitions repositories (brokers).

© Wipro Technologies - Wipro Confidential - Not for Distribution

Web Services



Web services are platform-independent interfaces that allow communication with other applications using standards-based Internet technologies, such as HTTP and XML.



Web Services depend upon three key open standards to allow them to communicate regardless of the hardware they run on, operating system they run under, or programming language used to produce them.

© Wipro Technologies - Wipro Confidential - Not for Distribution

Standards for Web Services
 SOAP – The Simple Object Access Protocol specifies the format for messages passed between web services.  WSDL – The Web Service Description Language describes web services so that other web services know how to access them, what to send as input, what to expect as output.  UDDI – The Universal Description, Discovery and Integration standard is a searchable registry that allows web services to publish WSDL documents so other web services can find them by name or category.

© Wipro Technologies - Wipro Confidential - Not for Distribution

Emerging standards for Web Services
 IBM‟s WSFL and Microsoft‟s WS-Routing for handling complex business process workflow

 OASIS‟ SAML and Microsoft‟s WS-Security for handling Authentication and message integrity
 XAML and OASIS‟ BTP for handling transactions that span multiple enterprises and long lasting transactions to ensure that the outcomes of the transactions are reliable

© Wipro Technologies - Wipro Confidential - Not for Distribution

Need of Business Process
 SOAP, WSDL and UDDI, none of these standards allow defining business semantics of Web Services. Thus, today Web Services are isolated and opaque. Breaking isolation means connecting Web Services and specifying how collections of web services are jointly used to realize more complex functionality – typically Business Process

 An on demand business is an enterprise whose business processes – integrated end-to-end across the company and with key partners, suppliers and customers can respond with speed to any customer demand, Market Opportunity or External threat

© Wipro Technologies - Wipro Confidential - Not for Distribution

Business Process Modeling?
 Methodology


Direction of Modeling (objectives, Boundary of Process, measurement, …)

 Pattern of process re-design
  

Automation Aggregate inefficient processes. Integrate different processes.

 Target of process Modeling


Business process boundary, level, pickup target element, related resources.

 Set target process performance value

© Wipro Technologies - Wipro Confidential - Not for Distribution

How to create Business Process?
 Create Process


Place process elements and wire those
 Set condition ( IO conditions, Break condition, …)

  

Set Interface
Set organization unit and location Create Business Item, Resource and Organization and map those to a flow

 Others
 

Add monitoring point Set KPI ( Key performance Indicator)

© Wipro Technologies - Wipro Confidential - Not for Distribution

Sample Business Process
 Processing a claim in an insurance company

© Wipro Technologies - Wipro Confidential - Not for Distribution

Execution Model of a Process
 Long-running process
 

Interruptible Persistent
 State stored persistently in database  Usage of persistent messaging to reliably hold the navigation information of the flow



Transacted Execution: each step in the process is fully recoverable

 Microflow
   

Non-interruptible Single unit of work Not persistent -> no database / message queueing system involved High throughput

© Wipro Technologies - Wipro Confidential - Not for Distribution

Process Modeling Patterns
 Dynamic Expiration  Escalation using Expiration  Dynamic Staff Assignment (IBM BPEL Extension)

 Staff: 4-eyes principle (IBM BPEL Extension)
 (Pseudo-)Synchronous JMS invokes

© Wipro Technologies - Wipro Confidential - Not for Distribution

Process Modeling Best Practices
 Process base class  Process Template Versioning  Description Field feature

 Façade consideration
 WS-I Compliance  Data mapping  Transformer Nodes

© Wipro Technologies - Wipro Confidential - Not for Distribution

Business Integration
 You Desire to Associate:
 Information  Processes  People

 Business Integration is the capability to achieve this goal  Many Types:
 Applications to Applications  Staff with Applications  Staff Only  Business Partners  Many More …..

© Wipro Technologies - Wipro Confidential - Not for Distribution

Business Integration Reference Architecture

© Wipro Technologies - Wipro Confidential - Not for Distribution

Business Process Execution Language
 BPEL does what it says on the tin, it is an XML language that defines how a business process can be executed using Web Service. The „for web services‟ means that the only interface that BPEL supports is SOAP and XML Messages. It simplifies the language because it does not have to support a myriad of protocols, formats and interfaces. The importance of BPEL is that it enables users to define the process in a way that the business can understand and that definition can be used directly to implement the process. The language is complete enough to define any business process flow









© Wipro Technologies - Wipro Confidential - Not for Distribution

Why BPEL and WSDL?
  BPEL is essentially a layer on top of WSDL, with WSDL defining the specific operation allowed and BPEL defining how the operations can be sequenced. Every BPEL process is exposed as a web service using WSDL. The WSDL describes the public entry and exits points for the process.



WSDL data types are used within BPEL process to describe the information that passes between request. Finally, WSDL can be used to reference external services required by the process.

© Wipro Technologies - Wipro Confidential - Not for Distribution

BPEL And WSDL

© Wipro Technologies - Wipro Confidential - Not for Distribution

Structure Of BPEL Process

© Wipro Technologies - Wipro Confidential - Not for Distribution

Structure of BPEL Process

© Wipro Technologies - Wipro Confidential - Not for Distribution

BPEL Elements – Partner Links
 Partner: BPEL term for any entity that a process is interacting with
   Business Partner, i.e. a web service Internal Service, i.e. an EJB Process Starter, e.g. a web application



Partner Link: “Placeholder” for a partner
   Part of the process definition No need to specify concrete service endpoints within the process model Allows for late binding of partners (at assembly time – build time)



Allows for Lang-Running, stateful interaction with a partner

© Wipro Technologies - Wipro Confidential - Not for Distribution

BPEL Element - Variables
 Hold data that constitutes the state of a process
  

May be received from or sent to partners Can be specified as input or output variables for invoke, receive, and reply activities May hold state data related to the process and never exchanged with partners.

 Associate with WSDL message types

© Wipro Technologies - Wipro Confidential - Not for Distribution

What is Activity?
 Activity:
A task that forms one logical step in a process definition. Can be Automated or Manual. Automation refers to the ability to define scripts and triggers during process operation. A common type of automated activity is deadline handling, which can automatically send a reminder message or trigger an escalation procedure if a work item fails to be completed by a prescribed deadline.

 Activity Owner:
An Activity Owner is the Participant that has the Authority to declare an activity complete, thus forwarding the work to the next activity in the process.

© Wipro Technologies - Wipro Confidential - Not for Distribution

Basic BPEL Activities

© Wipro Technologies - Wipro Confidential - Not for Distribution

XML Representation of BPEL Basic Activities

© Wipro Technologies - Wipro Confidential - Not for Distribution

Continue…

© Wipro Technologies - Wipro Confidential - Not for Distribution

Structured BPEL Activities

© Wipro Technologies - Wipro Confidential - Not for Distribution

XML Representation of BPEL Structured Activities

© Wipro Technologies - Wipro Confidential - Not for Distribution

IBM Specific BPEL Extensions

© Wipro Technologies - Wipro Confidential - Not for Distribution

Nesting Structured Activities - Example

© Wipro Technologies - Wipro Confidential - Not for Distribution

Representation of Structured Activities
Sequence: Graphical Representation

© Wipro Technologies - Wipro Confidential - Not for Distribution

XML Representation of Sequence Activity:
<sequence name=“ReserveFlight”> <target linkName=“Link3”/> <source linkName=“Link6”/>

<assign name=“prepareFlightPartner”>
<copy> <from part=“cityFrom” variable=“NiceJourneyInput”/> <to part=“cityFrom” variable=“FlightBookingRequest”/> </copy> </assign> <invoke inputVariable=“FlightBookingRequest” name=“InvokeFlightPartner” operation=“makeReservation” outputVariable=“FlightBookingResponse” partnerLink=“FlightBookingSystem” portType=“wsdl1:BookingSystemPortType”/> </sequence>

© Wipro Technologies - Wipro Confidential - Not for Distribution

Switch: Graphical Representation

© Wipro Technologies - Wipro Confidential - Not for Distribution

XML Representation of Switch Activity:
<switch name=“BookCarSwitch” xmlns=“http://rental-chain.org/car-booking”> <case condition=“bpws:getVariableProperty(dailyPrice) > 100”> <sequence>

<invoke name=“Invoke”/>
</sequence> </case> <case condition=“bpws:getVariableProperty(dailyRental) >= 0”> <sequence> <assign name=“Assign”/> </sequence> </case> <otherwise> <terminate name=“Terminate”/> </otherwise> </switch>

© Wipro Technologies - Wipro Confidential - Not for Distribution

While: Graphical Representation

© Wipro Technologies - Wipro Confidential - Not for Distribution

XML Representation of While Activity:
<while name=“WhileMoreBookings” condition=“bpws:getVariableData(moreFlightsToBook) == true”> <invoke inputVariable=“FlightBookingRequest” name=“InvokeFlightPartner” operation=“makeReservation” outputVariable=“FlightBookingResponse” partnerLink=“FlightBookingSystem” portType=“wsdl1:FlightBookingSystemPortType”/> </while>

© Wipro Technologies - Wipro Confidential - Not for Distribution

Pick: Graphical Representation

© Wipro Technologies - Wipro Confidential - Not for Distribution

XML Representation of Pick Activity:
<pick name=“PickCarRentalReply”> <onMessage operation=“XYZCarRental” partnerLink=“XYZCarRental” portType=“wsdl0:XYZCarRental” operation=“bookingXYZ” variable=“XYZCarRentalReply” </onMessage> <onMessage operation=“ABCCarRental” partnerLink=“ABCCarRental” portType=“wsdl0:ABCCarRental” operation=“bookingABC” variable=“ABCCarRentalReply” </onMessage> </pick>

© Wipro Technologies - Wipro Confidential - Not for Distribution

Flow: Graphical Representation

© Wipro Technologies - Wipro Confidential - Not for Distribution

XML Representation of Flow Activity:
<flow> <links> <llink name=“CreditDecisionOuput_to_CallCreditCardServiceInput”/> <link name=“CreditDecisionOuput2_to_CallDebitCardServiceInput”/> </links> <empty name=“WhichCreditType”> <source linkName=“CreditDecisionOutput2_to_callDebitCardServiceInput”></source> <source linkName=“CreditDecisionOuput_to_CallCreditCardServiceInput”></source> </empty> <invoke inputVariable=“CreditRequest” name=“CallCreditCardServiceCallCardServiceInput” operation=“processPayment”

© Wipro Technologies - Wipro Confidential - Not for Distribution

Continue…
outputVariable=“CreditResponse” partnerLink=“CreditCardPayment” portType=“wsdl1:CreditCardPayment”> <target linkName=“CreditDecisionOuput_to_CallCreditCardServiceInput”/> </invoke> <invoke inputVariable=“DebitRequest” name=“CallDebitCardServiceCallDebitServiceInput” operation=“processPayment” outputVariable=“DEbitResponse” partnerLink=“DebitCardPayment” portType=“wsdl2:DebitCardPayment”> <target linkName=“CreditDecisionOuput2_to_CallDebitCardServiceInput”/> </invoke> </flow>

© Wipro Technologies - Wipro Confidential - Not for Distribution

BPEL Extension - Process

© Wipro Technologies - Wipro Confidential - Not for Distribution

BPEL Extension - Activities

© Wipro Technologies - Wipro Confidential - Not for Distribution

Process Modeling to Process Choreography

© Wipro Technologies - Wipro Confidential - Not for Distribution

BPEL Handlers and Scope
A Scope is a set of (basic or structured) activities. Each Scope can have two types of Handlers associated:


Fault Handlers. Many can be attached,
for different fault types.



Compensation Handlers. A single
compensation handler per scope.

© Wipro Technologies - Wipro Confidential - Not for Distribution

Fault Handlers
 Fault Handler catch and deal with faults


Process interacts with WSDL port, WSDL port may send fault message back to a process. Internal Fault (Throw activity)



 Fault reaching a fault handler means that regular processing within scope can no longer process.


All active work in the scope must be stopped.

 After Fault Handler completes successfully, processing may continue outside the scope


Processing of the scope is still considered to have ended abnormally.

© Wipro Technologies - Wipro Confidential - Not for Distribution

 Catch Element
 

Specifies fault to be handled Includes activity (simple or structured) to be performed if fault occurs <faultHandlers> <catch faultName=“noSeatsAvailable”> <invoke partner=“customer” portType=“travelPT” operation=“sendRejection” inputContainer=“rejection”/> </catch>

</faultHandlers>


May make use of compensation handlers to undo completed nested activities

© Wipro Technologies - Wipro Confidential - Not for Distribution

Fault Handling : Scope and Links

Directly Handling Fault

Throwing a Fault up

© Wipro Technologies - Wipro Confidential - Not for Distribution

Compensation Handler
 Used to reverse the work of a successfully completed scope


Compensation handler is “installed” after successful completion of the scope.

 Can be defined for each scope
 

Scopes can be arbitrarily nested
Syntactic shortcut for invoke activity
 Inline definition of compensation handler.  Equivalent to scope with compensation handler and invoke activity.

 Compensation activity can be any activity

© Wipro Technologies - Wipro Confidential - Not for Distribution

Compensation Handler Example
<scope name=“purchase”> <compensationHandler> <invoke partner=“Seller” portType=“SP:Purchasing” operation=“CancelPurchase” inputContainer=“getResponse” outputContainer=“getConfirmation”> </invoke> </compensationHandler> <invoke partner=“Seller” portType=“SP:Purchasing” operation=“SyncPurchase” inputContainer=“sendPO” outputContainer=“getResponse” </invoke> </scope>

© Wipro Technologies - Wipro Confidential - Not for Distribution

Compensation Graphical Example

© Wipro Technologies - Wipro Confidential - Not for Distribution

Default Compensation and Fault Handler
 Default Compensation Handler


Invokes compensation handlers of immediately enclosed scopes in the reverse order of the completion of the scopes. Is used if a scope does not explicitly define a compensation handler. Can be invoke explicitly.

 

 Default Fault Handler


Invokes compensation handlers of immediately enclosed scopes in the reverse order of the completion of the scope. Rethrows the exception.



© Wipro Technologies - Wipro Confidential - Not for Distribution

Correlation Sets
 BPEL can model many types of interaction
 

Simple Stateless interactions. Stateful, Long Running, Asynchronous interactions.

 Correlation sets provides supports for the latter:
 

Correlation set represent the data that is used to maintain the state of the interaction. At the process end of the interaction, correlation set allow incoming messages to reach the right process instance.

 What is Correlation set?


A set of business data fields that capture the stateof the interaction (“correlating business data”) Each set is initialized once. Its values do not change in the course of interaction.

 

© Wipro Technologies - Wipro Confidential - Not for Distribution

XML Representation of Correlation Sets
<correlationSet name=“…” properties=“...”/> <!– A Correlation Set is a named set of properties -->

<bpws:property name=“…” type=“…”/> <!– A property has a simple XSD type and a global name -->

<bpws:propertyAlias propertyName=“…” messageType=“…” part=“…” query=“…”/> <!– Typically a property will be mapped to several different message types and carried on many interactions, across operations and portTypes -->

© Wipro Technologies - Wipro Confidential - Not for Distribution

The Future of BPEL
 The Web service Choreography Interface (WSCI) provides a design and functionality that is almost identical to BPEL‟s. The most significant difference is that WSCI doesn‟t supports graph based programming. There has been a great deal of discussion in the W3C Web Services activity regarding the formation of choreography working group that would take WSCI, BPEL and potentially other proposal as input. It doesn‟t take a great leap of imagination to see WSCI and BPEL combining together to form a single standard. The author and his company believe that any official standard should be available on Royalty-Free terms through an open standards process.





© Wipro Technologies - Wipro Confidential - Not for Distribution

Conclusion
 There are other languages that work in the same space (FDML, BPML,…) but BPEL now has sufficient industry backing to become the standard, and it will be extended where necessary to bring in any extra functionality from the other languages.  Business Process is exciting for many reasons but one major benefit is that once the business has defined the process it should be easier to plug and play the services that supports it.



This will allows evolutionary, and continuous, change and avoid the need for big band changes that are at best high risk and at the
worst practically impossible.



Schmeltzer places BPEL in the context of service oriented architecture (SOA): "One of the major benefits that people seek from SOA is re-use, and combining individual applications into composite applications is a great way to accomplish that. Because the more you do that, the more you're getting closer to building a business process."

© Wipro Technologies - Wipro Confidential - Not for Distribution

References
 http://www.ibm.com  http://www.oasis-open.org

 http://dev2dev.bea.com

© Wipro Technologies - Wipro Confidential - Not for Distribution


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:411
posted:8/29/2009
language:English
pages:57