Using a Pick Activity with an Alarm to Abort Waiting for a Message
Introduction
This sample demonstrates how to use a BPEL pick activity with an onMessage handler to wait for a message and an onAlarm handler stop waiting after a specified duration.
The process, illustrated below, consists of:
- A receive activity with the "createInstance" attribute set to yes
- An empty activity; pretend it is a one-way invoke.
- A pick activity containing:
- An onMessage handler to receive the client's response to the inquiry embodied by the one-way invoke. The onMessage handler contains an assign to set the process response according to the client's response
- An onAlarm handler with a duration of 5 minutes. The onAlarm handler contains an assign to set the process response to indicate that the transaction was canceled due to the occurrence of a timeout
- An reply activity corresponding to the receive
Note: The onMessage icon is annotated with a warning because it's not correlated. Likewise for the receive in the diagran below. The above pick and its contents are functionally equivalent to a scope containing:
- A flow primary activity containing linked receive and assign activities; and
- An onAlarm event handler containing an assign.
Deploying the Process
Running the Process
See Running the Samples.
The
service name to use is pick_alarmProcessService.The sample data file
orderMessage.xml can be used as input for this example.
Copyright © 2004–2007 Active Endpoints, Inc.
