Using Event Handlers

You add event handlers to enable a running process to react to events that may occur. You can add event handlers to your process, at either the process or scope level.

Event handlers run in tandem with a scope and are part of normal scope behavior. When a scope is active the event handler waits for the specified events. They do not take over regular processing like fault or compensation handlers do.

There are two types of events:

How do they work?

When to use an event handler

To add an event handler

Event handlers must be added to the start of the process.

  1. In the BPEL Editor, right-click at the start of your process diagram, and select Add Event Handler. An OnEvent handler is added to the process.

    If you want to add an OnAlarm handler, right-click and select Add OnAlarm. If you only want an OnAlarm event handler, you can delete the original OnEvent handler.

  2. In the empty scope, add whatever activities you need to activate the event handler.
  3. You can add additional event handlers to the process.
    add event handlers
  4. In the OnAlarm properties view, you can configure the type, date, and time duration of the alarm event.

For more information about event handlers and event handling, see the Event Handler section of the BPEL Specification.

Related Topics
Bullet How do I Handle Faults?
Bullet What is Correlation?
Bullet Using Compensation Handlers