Working with Event Collections

This topic provides an overview of the executables for working with event collections.

You can group a set of events that exhibit a common behavior as a collection. When you subscribe to a collection, you receive notifications for all the events included in the collection whenever they are published from the server runtime.

Use the Define Server Event Collections page to define an event collection.

Access PeopleTools > Push Notifications > Define Event Collections.

Image: Define Server Event Collections Page

This example illustrates how you can define an event collection.

Define Server Event Collections page

Field or Control

Definition

Collection Name

Enter the unique name for the event collection.

Description

Enter the description of the event collection.

Handler - Application Package

(Optional) Select the PeopleCode application package that contains the'Handler - Application Class.

Handler - Application Class

(Optional) Select the PeopleCode application class that can receive the events which are part of the event collection when they are published. A valid handler class implements the interface PT_PNCOLL_HANDLER:Handler.

Events

Click the link to add events to the event collection.

When you click Events for a collection, the Add Events page appears where you add events to the collection. If you subscribe to the collection, then you will receive the push notifications for all the events added in this page.

You can subscribe to an Event Collection using the following JavaScript API.

SubscribeCollection(collection_name, callback_function_name)

Field or Control

Definition

collection_name

The name of the event collection to which you are subscribing.

callback_function_name

The function invoked if any of the events included in the collection are published on the server.

Collection-name is the name of the event collection to be subscribed. Callback function name is t

See Subscribing to an Event Using JavaScript for an example of how to add the callback function.

These Application Data Set (ADS) definitions are for events and collections. You can use them to copy event and collection definitions between databases.

Field or Control

Definition

PTSVR_EVENTS

ADS definition for events for copying event definitions and their corresponding IWC subscription configurations.

PTPN_EVENT_COLLECTION

ADS definition for event collections for copying both collection definitions as well as all the associated event definitions for that collection.