Home arrow Web Services arrow Page 4 - Fault Handling with Web Services
WEB SERVICES

Fault Handling with Web Services


Last week, we looked at the assign and other basic activities, and studied flow. This week, we'll be examining more sturctured activities, and fault handling. This article, the fifth in a six-part 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).

Author Info:
By: Sams Publishing
Rating: 4 stars4 stars4 stars4 stars4 stars / 20
August 31, 2006
TABLE OF CONTENTS:
  1. · Fault Handling with Web Services
  2. · Fault Handling
  3. · Fault Handler Example
  4. · Event Handling

print this article
SEARCH DEVARTICLES

Fault Handling with Web Services - Event Handling
(Page 4 of 4 )

Event handlers can be associated with a scope or a process for concurrent processing of events. BPEL defines two types of events:

  • Message event—Implements a request-response or one-way operation invoked by a business partner

  • Alarm event—Implements timer-driven behavior

When a scope is active, then event handlers attached to the scope are enabled to receive concurrent messages or alarm events. They are disabled when the processing of the scope ends. Events can only be processed when the corresponding event handler is enabled. When the event handlers for a scope become disabled, running event handlers are allowed to complete. The scope is terminated when all event handlers have completed processing.

During the processing of message events, the event handler remains enabled. Therefore, it can concurrently process multiple events of the same type. In addition to flow activities, this is the second place in BPEL where concurrency is possible. Note that event handlers for a process can't create new process instances.

If an alarm event handler is specified with a duration, then this duration starts when the event handler for the scope is enabled.

In the following example, an event handler is defined that allows a partner to end the lifecycle of the process instance:

<eventHandlers>
<onMessage partnerLink="buyer" 
portType="purchaseOrderPortType" 
operation="cancelPurchaseOrderRequest" 
variable="purchaseOrderCancellation">
<correlations>
<correlation set="orderCorrelationSet"
initiate="no"/> </correlations> <terminate/> </onMessage> <onAlarm> ... </onAlarm> </eventHandlers>

If a buyer chooses to cancel a previously submitted purchase order, the cancellation request is processed by a concurrent event handler. The correct process instance is located using the correlation set definition introduced earlier. In this sample, the event handler is implemented by a terminate activity, which causes the activities on all parallel branches of the process to stop immediately.

Please check back next week for the conclusion of this article.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
WEB SERVICES ARTICLES

- Dealing with Loose Coupling in a Service-Ori...
- Loose Coupling in a Service-Oriented Archite...
- 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

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials