FeaturesPluginsDocs & SupportCommunityPartners

Developer Guide to BPEL Designer: Using Handlers


Contents

Developer Guide to BPEL Designer

Using Handlers



The following sections describe, in order of their appearance:

  • The circumstances when you would use a specific handler.
  • The use of those elements within the context of the BPEL Designer.

In this release of the BPEL Designer, you can add Fault Handlers and Event Handlers to your BPEL process. Compensation and Termination Handlers are not supported.

Using a Fault Handler



When to Use

The BPEL language provides the ability to catch and manage exceptions using fault handlers. For example, exceptions occur when web services return data different from what was expected. If faults are not handled, the entire BPEL process can be thrown into a faulted state. Therefore, to prevent the entire process from faulting, you can add fault handlers to catch and manage exceptions within particular scopes.

Each fault handler contains an activity that runs when there is an error. For example, a partner service is notified if an error has occurred. Fault handlers can be added to the entire process or to individual Scope elements.

You can attach one Fault Handler container to either the Process or the Scope element. Inside the Fault Handlers container, you can create several Catch activities configured to catch specific kinds of faults, or one Catch All handler element to catch all the exceptions not caught by specific handlers.

Usage

  1. Right-click on the Process element or any Scope element and invoke the Add Fault Handlers action. This does not add any particular fault handler, it just adds a container element to which you can then add specific fault handlers.
  2. Once you have added a Fault Handlers container, right-click on the Fault Handlers element to add a Catch or Catch All element. You may add as many specific Catch elements as you wish to the Fault Handlers group. You can add only one Catch All element per Fault Handlers container.

Catch Element

Use this element to intercept and deal with a specific kind of fault.

This element is used within an appropriate Fault Handlers container element.

Catch Element Properties

The properties of the Catch element are defined in the Properties window. You can also right-click the element on the diagram and choose Properties. The available properties are:

  • Fault Name. Select the qname of the fault from the list of faults, which includes system faults and the faults defined in the WSDL files.
  • Fault Variable Name property. Specify the name of the BPEL variable that will contain the fault message. This should be the name of an already defined BPEL variable, and it should be of the proper type to hold the fault message.
  • Fault Variable Type. Specify the type of the variable; it should match the type of the fault data. You can select the following types: schema or message type.

Catch Properties Window

Catch All Element

Use the Catch All element to intercept and deal with all faults that are not caught by an associated catch element.

The Catch All element is used within a fault handler window along with one or more catch elements. It is defined within a Fault Handlers container element along with one or more catch elements.

There are no properties for the Catch All element. Its behavior is pre-defined and requires no property configuration.

Fault Handler property editor

There are no specific properties for the Fault Handlers container element. It is an element that provides containment for a collection or group of Catch and Catch All elements.

top


Using an Event Handler



When to Use

The whole Process as well as each individual Scope can be associated with a set of Event Handlers that are invoked concurrently if the corresponding event occurs. The actions taken within an Event Handler can be any type of activity, such as Sequence or Flow. The only immediate child of an Event Handler is Scope, so when you drag an element from the Palette into an Event Handler, it is automatically wrapped in Scope.

There are two types of events. First, events can be incoming messages that correspond to a request/response or one-way operation in WSDL. For instance, a status query is likely to be a request/response operation, whereas a cancellation may be a one-way operation. Second, events can be alarms that go off after user-set times.

Usage

  1. Right-click the Process element or any Scope and invoke the Add Event Handlers action. This does not add any particular Event Handler, it just adds a container element to which you can then add specific Event Handlers.
  2. Once you have added an Event Handlers container, you can right-click on the Event Handlers element to add an OnEvent or OnAlarm branch. You may add as many specific OnEvent or OnAlarm elements as you wish to the Event Handlers group.

OnEvent Element

The OnEvent element indicates that the specified event waits for a message to arrive. The interpretation of this tag and its attributes is very similar to a Receive activity.

Usage

  1. Right-click the Event Handlers container and choose Add > On Event.
  2. Double-clicking the OnEvent element opens a property editor where you can specify/change the following:
    • The partner link
    • The operation associated with the OnEvent element
    • The event variable

    OnEvent Property Editor

  3. Right-clicking the OnEvent element and choosing Properties opens a Properties window where you can review and modify the properties of the element. In addition to the properties present in the property editor, the Properties window contains the PortType field, which is filled in when you specify the partner link and operation.

OnEvent Properties Window

A Correlations tab on the OnEvent element property editor enables you to examine or specify a correlation set.

The tab shows:

  • A correlation sets' name
  • The initiation of a correlator

You can add a correlation set by clicking the Add button. For more information, refer to Defining a Correlation Set and Adding a Correlation Set to an Element.

OnAlarm Element

The OnAlarm element specifies the deadline for or the duration of the nested Scope.

OnAlarm Element Properties

The properties of the OnAlarm element are defined in the Properties window, invoked by right-clicking the element on the diagram and choosing Properties. The available properties are:

  • Alarm Type is used to choose the type of alarm. The available options are:
    • For – specifies the duration for the process to wait.
    • Until – specifies the deadline for the process.
    • Repeat Every – specifies the frequency of process initiation. The given process will be initiated each time the specified duration period expires. The clock for the very first duration starts at the point in time when the associated scope starts.
    • For + Repeat Every – specifies the frequency of process initiation after the duration of a wait time specified. The process will be initiated each time the duration period specified in the Repeat Every field expires. The first alarm is fired when the period of time specified in the For field expires.
    • Until + Repeat Every – specifies the frequency of process initiation based on the specified deadline. The process will be initiated each time the duration period specified in the Repeat Every field expires. The first alarm is fired when the deadline specified in the Until field is reached.
  • The second (and third, where available) property is used to specify the duration or deadline for the selected alarm type.

Event Handler property editor

There are no specific properties for the Event Handlers container element. It is an element that provides containment for a collection or group of OnEvent and OnAlarm elements.



top

Bookmark this page

del.icio.us furl simpy slashdot technorati digg
Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by