Web Services
  Home arrow Web Services arrow Flow 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  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
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

Flow and Web Services
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-08-24

    Table of Contents:
  • Flow and Web Services
  • XPath Extension Functions
  • Flows
  • Link Semantics
  • Putting Together the Flow Sample

  • 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

    AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th -1:00PM EST. Register Today!

    Flow and Web Services


    (Page 1 of 5 )

    Last week, we looked at process lifecycles. This week, we'll take a look at the assign and other basic activities, and study flow. This article, the fourth in a series, 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).

    The assign Activity

    Now let's look at how data can be manipulated and assigned as part of the process logic. BPEL provides a special activity type for updating variables: the assign activity. It lets you copy type-compatible data from one variable to another; you can also construct and insert new data using general XPath expressions. Expressions also provide for simple computations—for example, to prepare data for the invocation of Web services.

    The following snippets depict samples of various usages of assign activities. The first shows the copying of an entire variable:

    <assign>
    <copy>
    <from variable="poSubmissionRequest"/>
    <to variable="trueCopyOfPoSubmissionRequest"/>
    </copy>
    </assign>

    The next sample only copies a selected part from one variable to another variable:

    <assign>
    <copy>
    <from variable="poSubmissionRequest"
    part="purchaseOrder"/> <to variable="orderSuppliesRequest"
    part="orderSupplies"/> </copy> </assign>

    In the following, you see a more complex assign activity that copies two selected elements from one variable to another. This assignment is performed as an atomic operation. The selection of elements involves queries expressed in XPath as the query language:

    <assign>
    <copy>
    <from variable="poSubmissionRequest" 
    part="purchaseOrder" 
    query="/billTo/id"/>
    <to  variable="poSubmissionFaultInvalidPO" 
    part="customerID"/>
    </copy>
    <copy>
    <from variable="poSubmissionRequest" 
    part="purchaseOrder" 
    query="/id"/>
    <to  variable="poSubmissionFaultInvalidPO" 
    part="orderNumber"/>
    </copy>
    </assign>

    The next snippet initializes a variable using a literal value:

    <assign>
    <copy>
    <from><xsd:integer>0</xsd:integer></from>
    <to variable="itemCount"/>
    </copy>
    </assign>

    The final assign sample uses an expression to perform a simple computation:

    <assign>
    <copy>
    <from
    expression="bpws:getVariableData('itemCount')+1"/> <to variable="itemCount"/> </copy> </assign>

    The assign activity can also copy endpoint references to and from partner links. This aspect is useful whenever endpoint references are to be treated as data—for example, to exchange endpoint references with business partners as part of messages, or to compute endpoint references.

    SkatesTown uses this feature to send its endpoint reference to the supplier. It requests additional supplies using the orderSupplies operation. As part of this request, SkatesTown provides its endpoint reference. This enables the supplier to asynchronously respond to the request without the need to be statically bound to one particular seller. The supplier uses this endpoint reference to submit its response—for example, to invoke the seller's orderSuppliesOk operation. The following BPEL snippet depicts how SkatesTown's endpoint reference is copied to the request message. The assign activity copies the endpoint reference from role myRole of partner link supplier to the orderSuppliesRequest variable. This variable then serves as input for the orderSupplies operation:

    <assign>
    <copy>
    <from partnerLink="supplier"
    endpointReference="myRole"/> <to variable="orderSuppliesRequest"
    part="endpointReferenceOfSeller"/> </copy> </assign>

    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

    - 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...
    - WS Notification and WS Topics in the WS Reso...
    - Introducing the Implied Resource Pattern
    - Web Services and Stateful Resources
    - Deploying an EJB Application







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway