O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Business Process Execution Language for Web Services

Book Description

An Architects and Developers Guide to BPEL and BPEL4WS

  • Architecture, syntax, development and composition of Business Processes and Services using BPEL

  • Advanced BPEL features such as compensation, concurrency, links, scopes, events, dynamic partner links, and correlations

  • Oracle BPEL Process Manager and BPEL Designer Microsoft BizTalk Server as a BPEL server

  • In Detail

    Web services provide the basic technical platform required for application interoperability. They do not, however, provide higher level control, such as which web services need to be invoked, which operations should be called and in what sequence. Nor do they provide ways to describe the semantics of interfaces, the workflows, or e-business processes. BPEL is the missing link to assemble and integrate web services into a real business process BPEL4WS standardizes process automation between web services. This applies both within the enterprise, where BPEL4WS is used to integrate previously isolated systems, and between enterprises, where BPEL4WS enables easier and more effective integration with business partners. In providing a standard descriptive structure BPEL4WS enables enterprises to define their business processes during the design phase. Wider business benefits can flow from this through business process optimization, reengineering, and the selection of most appropriate processes . Supported by major vendors -- including BEA, Hewlett-Packard, IBM, Microsoft, Novell, Oracle, SAP, Sun, and others -- BPEL4WS is becoming the accepted standard for business process management.

    This book provides detailed coverage of BPEL4WS, its syntax, and where, and how, it is used. It begins with an overview of web services, showing both the foundation of, and need for, BPEL. The web services orchestration stack is explained, including standards such as WS-Security, WS-Coordination, WS-Transaction, WS-Addressing, and others. The BPEL language itself is explained in detail, with Code snippets and complete examples illustrating both its syntax and typical construction. Having covered BPEL itself, the book then goes on to show BPEL is used in context. by providing an overview of major BPEL4WS servers. It covers the Oracle BPEL Process Manager and Microsoft BizTalk Server 2004 in detail, and shows how to write BPEL4WS solutions using these servers.

    What you will learn from this book?

    Chapter 1 provides a detailed introduction to BPEL and Service Oriented Architecture (SOA). It discusses business processes and their automation, explains the role of BPEL, web services, and Enterprise Service Buses (ESB) in SOA, provides insight into business process composition with BPEL, explains the most important features, compares BPEL to other specifications, provides an overview of BPEL servers, and discusses the future of BPEL.

    Chapter 2 provides a detailed introduction to the Web Services Technology Stack. It discusses the important standards and specifications for using BPEL and implementing SOA with web services, such as WS-Security, WS-Addressing, WS-Coordination, WS-AtomicTransaction, WS-BusinessActivity, WS-Reliable Messaging, etc.

    Chapter 3 discusses the composition of web services with BPEL. The chapter introduces the core concepts of BPEL and explains how to define synchronous and asynchronous business processes with BPEL. The reader gets familiar with BPEL process structure, partner links, sequential and parallel service invocation, variables, conditions, etc.

    Chapter 4 goes deeper into the BPEL specification and covers advanced features for modeling complex business processes. Advanced activities, scopes, serialization, fault handing, compensations, event handling, correlation sets, concurrent activities and links, process lifecycle, and dynamic partner links are covered in detail.

    Chapter 5 explains how to use the Oracle BPEL Process Manager for deploying and executing business processes defined in BPEL. It describes the server architecture, tools, features, and common approaches for managing and debugging BPEL processes. The chapter also looks at graphical development of BPEL processes using Oracle BPEL Designer for JDeveloper and for Eclipse.

    Chapter 6 takes a detailed look at the advanced features of the Oracle BPEL Process Manager including extension functions, dynamic parallel flows, Web Services Invocation Framework, Java embedding, Notification service, Workflow service, Identity service, and Oracle BPEL Server APIs.

    Chapter 7 discusses MS BizTalk Server 2004 and its support for BPEL. It explains how to develop business processes in BizTalk and export them to BPEL. It also explains how to import BPEL processes into BizTalk and how to use the Orchestration Designer tool to define processes graphically, and compares BizTalk and BPEL constructs.

    Appendix A provides a syntax reference for BPEL version 1.1. The appendix covers standard BPEL activities and elements, functions, attributes, and faults.

    Who this book is written for?

    This book is aimed at architects and developers in the design, implementation, and integration phases of advanced information systems and e-business solutions, developing business processes and dealing with the issues of composition, orchestration, transactions, coordination, and security. The book presumes knowledge of XML and web services, web services development (either on J2EE or .NET), and multi-tier architecture

    Table of Contents

    1. Business Process Execution Language for Web Services
    2. Credits
    3. About the Authors
    4. About the Reviewers
    5. Preface
      1. What This Book Covers
      2. What You Need for Using This Book
      3. Conventions
      4. Reader Feedback
      5. Customer Support
        1. Downloading the Example Code for the Book
        2. Errata
        3. Questions
    6. 1. Introduction to BPEL and SOA
      1. Why Business Processes Matter
        1. Automation of Business Processes
          1. Exposing and Accessing the Functionality of Applications as Services
          2. Enterprise Bus Infrastructure for Communication and Management of Services
          3. Integration between Services and Applications
          4. Composition of Exposed Services into Business Processes
      2. Web Services
        1. How Web Services Differ from their Predecessors
        2. Web Services Technology Stack
      3. Enterprise Service Bus
        1. ESB Features
      4. Service Oriented Architecture
        1. SOA Concepts
          1. Services
          2. Interfaces
          3. Messages
          4. Synchronicity
          5. Loose Coupling
          6. Registries
          7. Quality of Service
          8. Composition of Services into Business Processes
      5. Service Composition
      6. BPEL for Service Composition
        1. BPEL Features
        2. Orchestration and Choreography
        3. Executable and Abstract Processes
      7. Relation of BPEL to Other Languages
        1. ebXML BPSS
        2. BPML
        3. WSCI
        4. WS-CDL
      8. BPEL Servers Overview
        1. Oracle BPEL Process Manager
        2. Microsoft BizTalk
        3. IBM WebSphere Business Integration Server Foundation
        4. IBM BPWS4J
        5. ActiveBPEL Engine and ActiveWebflow
        6. OpenStorm Service Orchestrator
      9. The Future of BPEL
      10. Conclusion
    7. 2. Web Services Technology Stack
      1. E-Business Collaborations
      2. WS-Security
        1. Example
        2. Binary Security Token
        3. Referencing an External Security Token
        4. Faults
      3. Typical Business Transaction Scenario
      4. WS-Coordination
        1. The Framework
        2. Scenario
          1. CoordinationContext
          2. CreateCoordinationContext
          3. CreateCoordinationContextResponse
          4. Register
          5. RegisterResponse
        3. Faults
      5. Web Services Transaction Specifications
        1. Atomic Transaction
          1. Sharing Context Information
          2. Coordination Protocols
            1. Completion
            2. CompletionWithAck
            3. Two-Phase Commit
            4. PhaseZero
            5. OutcomeNotification
        2. Business Activity
          1. Sharing the Context Information
          2. Coordination Protocols
            1. BusinessAgreement
            2. BusinessAgreementWithComplete
      6. OASIS BTP
        1. The BTP Stack
        2. The BTP Model
          1. Atomic Transactions
          2. Cohesive Transactions
      7. Reliable Messaging
        1. Messaging Model
          1. Example
          2. Requesting Acknowledgement
          3. Delivery Assurances
          4. Other Assertions
          5. Faults
      8. WS-Addressing
        1. Endpoint Reference
        2. Faults
      9. WS-Inspection
        1. Inspection Document Hierarchy
      10. WS-Policy
        1. Policy Outline
          1. The <wsp:All> Operator
          2. The <wsp:ExactlyOne> Operator
          3. The <wsp:OneOrMore> Operator
          4. The <wsp:Policy> Operator
        2. Policy Assertions
          1. Example
          2. Policy Inclusion
      11. WS-Eventing
        1. Event Subscription
        2. Response to Event Subscription
        3. Subscription Renewal
        4. Unsubscribing
        5. Subscription End Message
      12. Conclusion
    8. 3. Service Composition with BPEL
      1. Developing Business Processes with BPEL
      2. Core Concepts
        1. Invoking Web Services
        2. Invoking Asynchronous Web Services
        3. Synchronous/Asynchronous Business Processes
        4. Understanding Links to Partners
        5. Partner Link Types
        6. Defining Partner Links
        7. BPEL Process Tag
        8. Variables
        9. Providing the Interface to BPEL Processes: <invoke>, <receive>, and <reply>
          1. <invoke>
          2. <receive>
          3. <reply>
        10. Assignments
        11. Conditions
      3. BPEL Business Process Example
        1. Involved Web Services
          1. Employee Travel Status Web Service
          2. Airline Web Service
            1. Flight Availability Port Type
            2. Flight Callback Port Type
        2. WSDL for the BPEL Process
        3. Partner Link Types
        4. Business Process Definition
          1. BPEL Process Outline
          2. Partner Links
          3. Variables
          4. BPEL Process Main Body
      4. Asynchronous BPEL Example
        1. Modify the BPEL Process WSDL
        2. Modify Partner Link Types
        3. Modify the BPEL Process Definition
      5. Conclusion
    9. 4. Advanced BPEL
      1. Advanced Activities
        1. Activity Names
        2. Loops
        3. Delays
          1. Deadline and Duration Expressions
        4. Empty Activities
        5. Process Termination
      2. Fault Handling and Signaling
        1. WSDL Faults
        2. Signaling Faults
          1. Signaling Faults to Clients in Synchronous Replies
            1. Example
          2. Signaling Faults to Clients in Asynchronous Scenarios
        3. Handling Faults
          1. Selection of a Fault Handler
          2. Synchronous Example
          3. Asynchronous Example
          4. Inline Fault Handling
      3. Scopes
        1. Example
          1. First Scope
          2. Second Scope
          3. Third Scope
        2. Serializable Scopes
      4. Compensation
        1. Compensation Handlers
          1. Example
        2. Invoking Compensation Handlers
      5. Managing Events
        1. Pick Activity
          1. Message Events
          2. Alarm Events
          3. Example
        2. Event Handlers
          1. Example
      6. Business Process Lifecycle
      7. Correlation and Message Properties
        1. Message Properties
          1. Mapping Properties to Messages
          2. Extracting Properties
          3. Properties and Assignments
        2. Correlation Sets
        3. Using Correlation Sets
      8. Concurrent Activities and Links
        1. Sources and Targets
          1. Example
        2. Transition Conditions
        3. Join Conditions and Link Status
        4. Join Failures
          1. Suppressing Join Failures
      9. Dynamic Partner Links
      10. Abstract Business Processes
      11. Model Driven Approach: Generating BPEL from UML Activity Diagrams
      12. Conclusion
    10. 5. Oracle BPEL Process Manager and BPEL Designer: Overview
      1. Overview and Architecture
        1. BPEL Server
          1. Core BPEL Engine
          2. WSDL Bindings
          3. Integration Services
        2. BPEL Console
        3. BPEL Designer
        4. Database
      2. Process Deployment Example
        1. Process Descriptor
          1. Configuration Properties
        2. Setting the Environment
        3. BPEL Compiler and Revision Numbers
        4. Deployment and Domains
          1. Ant Utility
      3. Process Management with the BPEL Console
        1. Visual Flow
        2. Instance Auditing
        3. Debugging
        4. Overview of Other BPEL Console Functions
        5. Deploying Processes
        6. Management
        7. Performance Tuning
        8. Domains and Administration
          1. Administration of Server-Related Parameters
          2. Managing BPEL Domains
      4. Graphical Development with BPEL Designer
        1. JDeveloper BPEL Designer
          1. Importing Existing BPEL Processes
          2. Partner Links and Web Services
          3. Variables
          4. Process Activities
          5. Copy Rule Editor
          6. XPath Expression Builder
          7. XSLT Mapper
          8. BPEL Validation Browser
          9. Building and Deploying
        2. Eclipse BPEL Designer
          1. Partner Links and Web Services
          2. Variables
          3. XML Type Browser
          4. Process Map
          5. Copy Rule Editor
          6. Function Wizard
          7. Building and Deploying
      5. Summary
    11. 6. Oracle BPEL Process Manager: Advanced Features
      1. Extension Functions and Activities
        1. Transformation and Query Support
        2. Data and Array Manipulation
        3. XML Manipulation
        4. Date and Time Expressions
        5. Process Identification
        6. LDAP Access and User Management
      2. Dynamic Parallel Flow
        1. Dynamic Flow Example
        2. Providing a List of Partner Links
        3. Dynamic Parallel Invocation of Airline Services
        4. Dynamic Partner Links
        5. Offer Selection Loop
        6. Deploying and Testing the Example
      3. Web Services Invocation Framework
        1. Advantages of WSIF
        2. Java to XML Bindings
          1. XML Façades
        3. Invoking a Java Class through WSIF
          1. Defining WSIF Bindings in WSDL
          2. WSIF Bindings for Java Classes
          3. Testing the Example
        4. Exception Handling
          1. User Exceptions in Java
          2. Defining Faults in WSDL
          3. Defining WSIF Binding for an Exception
          4. Custom Exception Serializers
            1. Defining Custom Fault Type in WSDL
            2. Writing the Custom Exception Serializer
            3. Registering the Custom Exception Serializer
        5. Invoking EJB through WSIF
          1. WSDL for Session Bean
          2. WSIF Binding for EJB
        6. Generating WSIF Bindings from JDeveloper
      4. Java Code Embedding
        1. Invoking a Java Class from Embedded Code
      5. Notification Service
        1. Email Example
          1. Notification Wizard
          2. Review of Code
          3. Testing the Example
        2. Mail and JMS Services
      6. Workflow Service
        1. Workflow Patterns
        2. Example
          1. Checking User Outcome
          2. Worklist Application to Approve Ticket
      7. Identity Service
      8. BPEL Server APIs
      9. Summary
    12. 7. MS BizTalk Server
      1. Overview
        1. Support for BPEL and XLANG/s
      2. Architecture
        1. Ports
          1. Receive Locations
        2. Adapters
        3. Receive Pipelines
          1. Message Contexts
          2. Promoted Properties
          3. Distinguished Fields
        4. The MessageBox
          1. How Publish-Subscribe works
        5. Orchestrations
        6. Maps
        7. Business Rules Engine
        8. Send Pipeline
      3. Building a Sample Orchestration in BizTalk
        1. Scenario
        2. Implementation
      4. Exporting Orchestration to BPEL
      5. Importing BPEL Processes into BizTalk
      6. Do’s and Don’ts for BPEL Compliance in BizTalk
      7. Comparing BizTalk Orchestration Constructs with BPEL
        1. Receive and Send Shapes (<receive>, <invoke>, <reply>)
        2. Port and Role Link Shapes (<partnerLink>, <partnerLinkType>, <role>)
        3. Expression and Message Assignment Shapes (<assign>, <copy>, <from>, <to>)
        4. Decide Shape (<switch>, <case>, <otherwise>)
        5. Delay Shape (<wait>)
        6. Parallel Actions Shape (<flow>)
        7. Loop Shape (<while>)
        8. Suspend Shape
        9. Terminate Shape (<terminate>)
      8. Advanced BPEL Functions using BizTalk
        1. Listen Shape (<pick>, <onMessage>, <onAlarm>)
        2. Scope Shape (<scope>)
        3. Throw Exception Shape and Exception Handling (<throw>, <faultHandler>, <catch>, <catchAll>)
        4. Compensate Shape and Compensation Block (<compensate>, <compensationHandler>)
        5. Correlation (<correlations>, <correlationSets>)
      9. Other BizTalk-Specific Features
        1. Integration with other BizTalk Servers
        2. Integration with Web Services
        3. Integration with the .NET Framework
        4. Human Workflow Services (HWS)
        5. Business Activity Monitoring (BAM)
        6. Health and Activity Tracking (HAT)
      10. BizTalk Server 2006 and Beyond
      11. Summary
    13. A. BPEL Syntax Reference
      1. Important BPEL Activities and Elements
        1. <assign>, <copy>, <from>, <to>
          1. Syntax
          2. Example
        2. <catch>, <catchAll>
          1. Syntax
          2. Example
        3. <compensate>
          1. Syntax
          2. Example
        4. <compensationHandler>
          1. Syntax
          2. Example
        5. <correlations>, <correlation>
          1. Syntax
          2. Example
        6. <correlationSets>, <correlationSet>
          1. Syntax
          2. Example
        7. <empty>
          1. Syntax
          2. Example
        8. <eventHandlers>
          1. Syntax
          2. Example
        9. <faultHandlers>, <faultHandler>
          1. Syntax
          2. Example
        10. <flow>
          1. Syntax
          2. Example
        11. <invoke>
          1. Syntax
          2. Example
        12. <links>, <link>
          1. Syntax
          2. Example
        13. <onAlarm>
          1. Syntax
          2. Example
        14. <onMessage>
          1. Syntax
          2. Example
        15. <partnerLinks>, <partnerLink>
          1. Syntax
          2. Example
        16. <partnerLinkType>, <role>
          1. Syntax
          2. Example
        17. <partners>
          1. Syntax
          2. Example
        18. <pick>
          1. Syntax
          2. Example
        19. <process>
          1. Syntax
          2. Example
        20. <property>
          1. Syntax
          2. Example
        21. <propertyAlias>
          1. Syntax
          2. Example
        22. <receive>
          1. Syntax
          2. Example
        23. <reply>
          1. Syntax
          2. Example
        24. <scope>
          1. Syntax
          2. Example
        25. <sequence>
          1. Syntax
          2. Example
        26. <source>
          1. Syntax
          2. Example
        27. <switch>, <case>
          1. Syntax
          2. Example
        28. <target>
          1. Syntax
          2. Example
        29. <terminate>
          1. Syntax
          2. Example
        30. <throw>
          1. Syntax
          2. Example
        31. <variables>, <variable>
          1. Syntax
          2. Example
        32. <wait>
          1. Syntax
          2. Examples
        33. <while>
          1. Syntax
          2. Example
      2. BPEL Functions
        1. getLinkStatus()
          1. Syntax
          2. Example
        2. getVariableData()
          1. Syntax
          2. Example
        3. getVariableProperty()
          1. Syntax
          2. Example
      3. Deadline and Duration Expressions
      4. Standard Elements
        1. Syntax
      5. Standard Attributes
        1. Syntax
      6. Default Values of Attributes
      7. Standard Faults
      8. Namespaces