Web Services
  Home arrow Web Services arrow Page 3 - Business Processes and Web Services
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB SERVICES

Business Processes and Web Services
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2006-08-10

    Table of Contents:
  • Business Processes and Web Services
  • WSDL Extensions for Interactions with a Business Process
  • Overall Structure of a Process
  • Basic and Structured Activities

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Business Processes and Web Services - Overall Structure of a Process


    (Page 3 of 4 )

    Having specified the external interface of a BPEL process in the previous section, let's look at the internal structure of a process. The simplified example in Listing 12.1 introduces a business process to handle purchase orders: PurchaseOrderProcess. This process orchestrates the steps that are necessary to deal with the purchase order submitted by a SkatesTown customer. It fulfills the specification and requirements as outlined earlier. We'll use this process definition throughout the chapter as the means to explain the constructs provided by BPEL.

    Listing 12.1 Structure of a BPEL Process

    <!-- Process definition (1) -->
    <process name="purchaseOrderProcess" 
    targetNamespace="http://www.skatestown.com/
    processes/purchaseOrderProcess" xmlns:pos="http://www.skatestown.com/
    services/interfaces/poSubmission.wsdl" xmlns:skt="http://www.skatestown.com/
    services/interfaces/skatestown.wsdl" xmlns:sup="http://www.wheelsandboards.com/
    services/interfaces/orderSupplies.wsdl" xmlns:plt="http://www.skatestown.com/
    processes/poSubmissionPLT" xmlns:ppa="http://www.skatestown.com/
    processes/poSubmissionPPA" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/
    ws/2003/03/business-process/"> <!-- Partner link definitions (2) --> <partnerLinks> <partnerLink name="buyer" partnerLinkType=
    "plt:purchaseOrderPartnerLinkType" myRole="seller"/> <partnerLink name="supplier" partnerLinkType=
    "plt:allocateStockPartnerLinkType" myRole="seller" partnerRole="supplier"/>
    ... </partnerLinks> <!-- Partner definitions (3) --> <partners> <partner name="skatestownCustomer"> <partnerLink name="buyer"/> </partner> <partner name="skatestownSupplier"> <partnerLink name="supplier"/> </partner> ... </partners> <!-- Variable definitions (4) --> <variables> <variable name="poSubmissionRequest" messageType="pos:poSubmissionRequest"/> <variable name="poSubmissionResponse" messageType="pos:poSubmissionResponse"/> <variable name="poSubmissionFaultInvalidPO" messageType=
    "pos:poSubmissionFaultInvalidPO"/> ... </variables> <!-- Correlation set definitions (5) --> <correlationSets> <correlationSet name="orderCorrelationSet" properties="ppa:customerID
    ppa:orderNumber"/> </correlationSets> <!-- Fault handler definitions (6) --> <faultHandlers> <catch faultName="pos:invalidPO"> ... </catch> ... </faultHandlers> <!-- Event handler definitions (7) --> <eventHandlers> <onMessage partnerLink="buyer" portType="pos:poSubmisssionPortType" operation="cancelPurchaseOrder" ...> ... </onMessage> </eventHandlers> <!-- Body of business process (8) --> <sequence> <!-- receive purchase order from buyer
    (service requester) --> <!-- process purchase order, involves web
    services of supplier --> <!-- reply invoice to buyer
    (service requester) --> ... </sequence> </process>

    The definition of a BPEL process (at number 1 in the code) starts with process- specific attributes as part of its root element, such as the name of the process and its target namespace or the type of the business process. BPEL distinguishes two types of processes, and hence can be applied to two distinct usage scenarios:

    • Implementing executable processes

    • Describing nonexecutable abstract processes

    Our focus is on the first scenario. We'll discuss abstract processes briefly toward the end of the chapter.

    Process PurchaseOrderProcess involves various business partners. The customer (as the buyer) submits a purchase order. SkatesTown (as the seller) responds to the customer when the order is complete. SkatesTown also contacts the supplier when stock needs to be replenished to process the purchase order appropriately. As part of the BPEL process, interactions between partners are expressed through partner links (2). Often the conversation between two business partners involves multiple peer-to-peer interactions. The partners g section (3) is a means to group multiple partner links, and as such expresses the capabilities required from a business partner.

    The interaction between business partners is based on exchanging messages: The buyer sends a purchase order to the seller; the seller receives the purchase order and exchanges messages with its supplier. Variables (4) are the construct in BPEL to store such messages. In addition, variables can hold data that isn't exchanged with partners—data that is only needed for the internal processing of the business process.

    Multiple interactions between partners might be involved in a specific business process instance that happens over a long period of time—days, months, or even years. This requires a means to identify a particular process instance that deals with, for example, a specific purchase order. BPEL introduces the notion of correlation sets (5) for this purpose.

    The next sections of the process definition specify different kinds of handlers for the process:

    • Fault handlers to catch process faults at the process level (6)

    • Event handlers to deal with unsolicited events that can be received and processed in parallel with overall process execution (7)

    Finally, a single activity specifies the implementation of the BPEL process: the body of the process (8). In general, this activity consists of nested activities. In our example, these are all the activities needed to handle a purchase order, and their order of execution. Since a business process is always initiated through the receipt of a message, the first step of a process needs to be an activity that can receive a message from a partner.

    To summarize, the overall structure of a BPEL process consists of

    • Process-specific, top-level attributes

    • Partner-related specifications (partner links and partners)

    • Variables

    • Correlation sets

    • Fault handlers and event handlers

    • An activity that specifies the business logic of the overall process

    More Web Services Articles
    More By Sams Publishing


       · This article is an excerpt from the book "Building Web Services with Java: Making...
     

    Buy this book now. This article is excerpted from chapter 12 of Building Web Services with Java: Making sense of XML, SOAP, WSDL, and UDDI, written by Steve Graham et al. (Sams; ISBN: 0672326418). Check it out today at your favorite bookstore. Buy this book now.

    WEB SERVICES ARTICLES

    - Safety, Idempotence, and the Resource-Orient...
    - The Resource-Oriented Architecture in Action
    - Features of the Resource-Oriented Architectu...
    - The Resource-Oriented Architecture
    - Getting Started with Flex
    - Automated Billing and Faxing for the Web
    - An Introduction to Web Services
    - The Foundations of Web Services: From Novice...
    - Web Services Reengineering: Finishing Touches
    - Fault Handling with Web Services
    - Flow and Web Services
    - Process Lifecycles and Web Services
    - Business Processes and Web Services
    - Orchestrating Web Services
    - Notifications and Resources in the WS-Resour...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek