Testing Event Handlers and Events

This section provides an overview of event testing.

Page Name

Definition Name

Usage

Event Manager - Test an Event Handler Page

EOEN_HNDLR_TEST

Execute a single event handler as a standalone process without raising an event. Use this feature for testing and debugging event handlers.

Event Manager - Raise an Ad-Hoc Test Event Page

EOEN_EVENT_TEST

Raise a selected business event that you have defined on an ad hoc basis without invoking the business process that normally raises the event. This enables you to test events without having to perform the business operation that normally raises the event.

Execute a single event handler as a standalone process without raising an event. Use this feature for testing and debugging event handlers.

Generally in a production environment, you raise events by making a change to application data through a component or by running a PeopleTools Application Engine process. When the event is raised, the Event Manager framework executes the event handlers registered with the event as defined in the Event Registry component. When testing events, you should begin at the lowest level, which is the event handler, and then work your way up to the highest level, which is the business process that raises the event. Thus, to test events:

  1. Test the event handler in standalone mode through the Handler Tester component.

  2. Test the event independent of the business process that raises the event through the Event Tester component.

  3. Test the event in the context of the business process by executing the business process that raises the event through the component or PeopleTools Application Engine process.

Use the Event Manager - Test an Event Handler page (EOEN_HNDLR_TEST) to execute a single event handler as a standalone process without raising an event.

Use this feature for testing and debugging event handlers.

Image: Event Manager - Test an Event Handler page

This example illustrates the fields and controls on the Event Manager - Test an Event Handler page. You can find definitions for the fields and controls later on this page.

Event Manager - Test an Event Handler page

Field or Control

Definition

Event

Select the event to which the event handler that you want to execute is registered. Event handlers must always execute within the context of an event.

Record

When you select an event, the system also allows you to select a record to provide data for the event. Typically, this is the record in the database from which a data change normally raises the event. however you can select a different record. The record must have the same keys as the record that normally raises the event. After you select a record the fields from the record are populated on the page with fields to enter values, expected types and lengths. Enter your sample data for your Event Test in the value fields and click the Execute button.

The system displays in the Registered Handlers group box the event handlers that are registered with the selected event in the local database through the Event Registry component.

Registered Handlers

This group box displays the event handlers that you have registered with the selected event in the Event Registry component.

Field or Control

Definition

Execute

Click to execute the selected event handler. Before you can execute an event handler, you must select the event, record, and event handler and enter the event data that you want to pass to the event handler. You can execute only one event handler at a time.

The system executes the event handler immediately regardless of any settings in the Event Registry component. When testing an event handler through this page, the system does not raise an event, publish the generic PeopleTools Integration Broker message, or generate log entries.

The system displays the status of the event handler execution to the left of this button and displays any exceptions that the event handler creates in the Handler Exceptions group box directly on this page.

Execution Status

Indicates that you have not yet executed the event handler.

Successful Execution

Indicates successful execution of the event handler.

Event handler executes with fatal error

Indicates that the system executed the event handler with a fatal error.

Handler Exceptions

Use this group box to view results of the event handler execution. The system displays event keys, exceptions, and trace information that is associated with the execution of the event handler.

Field or Control

Definition

Event keys

The system displays the event data that the system used during the execution of the event handler. At a minimum, the system displays the event data in the Handler Exceptions group box after execution of the event handler.

Exception Information

The system displays the exception information that the system generated during execution of the event handler.

Warnings during execution of event handler

The warnings that the system generated during execution of the event handler.

Execution failed

The errors that the system generated during execution of the event handler.

Trace information during execution of event handler

The trace information that the system generated during execution of the event handler.

Event Fields

Use this group box to enter values for each of the fields that are part of the selected event and record. These are the values that the system passes into the event handler during the test. The system does not perform any validation on the data that you enter in the Value fields. Be sure to enter the correct format for data values and use uppercase or lowercase values for character data as appropriate. The system makes this data available to the event handlers as the Context Record for the Event.

Use the Event Manager - Raise an Ad-Hoc Test Event page (EOEN_EVENT_TEST) to raise a selected business event that you have defined on an ad hoc basis without invoking the business process that normally raises the event.

This enables you to test events without having to perform the business operation that normally raises the event.Execute a single event handler as a standalone process without raising an event. Use this feature for testing and debugging event handlers.

Image: Event Manager - Raise an Ad-Hoc Test Event page

This example illustrates the fields and controls on the Event Manager - Raise an Ad-Hoc Test Event page. You can find definitions for the fields and controls later on this page.

Event Manager - Raise an Ad-Hoc Test Event page

Field or Control

Definition

Event

Select the event that you want to raise. You can only raise events that are active in the local event registry. If you are unsure of the status of an event, select the event in the Event field and click the Event Info button.

Record

When you select an event, the system allows you to select a record to provide data for this event. Typically, this is the record in the database from which a data change normally raises the event.

The system displays the Event Fields grid so that you can enter data to pass to the event.

Event Info button

Click the Event Info button to view select information from the Event Registry component about the selected event and its registered event handlers. The system displays the Registry Info group box, which contains the event details.

Raise Event

Click this button to have the Event Manager framework raise the event with the specified event data.

The system processes the event and executes all active event handlers that you have registered to the event exactly as if you have raised it from the normal business process such as through a component or PeopleTools Application Engine process.

The system displays a message below the Record field indicating whether you have successfully raised the event. This message also includes the event ID on the local node and, for multichannel events, the event channel.

Launch Event Monitor

After you raise the event, click this link to view the execution status of the raised event. The system launches the Event Monitor component in a new browser window and automatically displays information for this particular event instance.

Registry Info

Use this group box to view select information from the Event Registry component about the selected event and its registered handlers. The system displays this group box only if you select an event and click the Event Info button. To change any of this data, you must access the Event Registry component for the selected event.

Event Fields

Use this group box to enter values for each of the event fields that are part of the event that you are raising. The system does not perform any validation on the data that you enter in the Value fields. Be sure to enter the correct format for data values and use uppercase or lowercase values for character data as appropriate. The system makes these field values available to the event handlers as the context record for the event.