Subscribing to TREE_CHANGE Service Operations

This topic discusses how to subscribe to TREE_CHANGE service operations.

Every time you perform an action in PeopleSoft Tree Manager to change a tree definition (such as delete, any kind of save, copy, branch, or unbranch), a TREE_CHANGE service operation is published based on the Tree Key information using the PSTREEPUBSUB record.

Note: From PeopleTools 8.48, sending a TREE_CHANGE service operation every time tree changes are made is optional. To improve performance, you can select not to send a TREE_CHANGE service operation whenever you change a tree definition. The default setting is sending a TREE_CHANGE service operation. This service operation is not saved to the database.

If applications want to use TREE_CHANGE service operation, they must create a service operation handler. The service operation handler runs every time this service operation is published.

Image: Example of the TREE_CHANGE service operation

This example shows the TREE_CHANGE service operation.

Example of the Tree Change service operation

Note: The field EVENT_ID is defined in the Financials database as a Char,20 field, and is used by a number of applications. In PeopleTools PSTREEPUBSUB, the field was defined as a Number,6. To avoid conflicts, EVENT_ID has been removed from PSTREEPUBSUB and replaced with TREE_EVENT_ID.

This change may affect applications who subscribe to the TREE_CHANGE event, and check for EVENT_ID in PeopleCode using field name.

To create a notification PeopleCode:

  1. Select Go > PeopleTools > Application Designer.

  2. Create an application package and an application class that implements PS_PT: Integration: INotificationHandler interface.

    For a subscription, you use the INotificationHandler application class and the OnNotify method, and optionally use the OnError method for error handling.

    Note: This application package PeopleCode is tied to the TREE_CHANGE service operation through a service operation handler.

Image: Example of creating notification PeopleCode (1 of 2)

This example shows an application class that is used to subscribe to TREE_CHANGE service operation (1 of 2).

Example of creating notification PeopleCode (1 of 2)

Image: Example of creating notification PeopleCode (2 of 2)

This example shows an application class that is used to subscribe to TREE_CHANGE service operation (2 of 2).

Example of creating notification PeopleCode (2 of 2)

In the previous example, TREE_CHANGE_SUB_TEST application class has three methods. The constructor, TREE_CHANGE_SUB_TEST and the event handler, OnNotify are required. TREE_CHANGE_SUB_TEST application class has an extra method LogToFile that is used for testing purposes only. This message records a data retrieved from a message being received.

To configure Integration Broker in PIA:

  1. Select PeopleTools > Integration Broker > Integration Setup > Services Operations.

    The search page appears.

  2. Select TREE_CHANGE service operation name, and click the Search button.

  3. Click the TREE_CHANGE link.

    The General page appears.

  4. On the General page, select the Generate Local-to-Local option.

    Local-to-local routing is auto-generated.

Image: General page - Service Operation

This example illustrates the fields and controls on the General page - Service Operation.

General page - Service Operation

Use the Handlers page to create a service operation handler.

Image: Handlers page - Service Operation

This example illustrates the fields and controls on the Handlers page - Service Operation.

Handlers page - Service Operation

To create a service operation handler:

  1. Select PeopleTools > Integration Broker > Integration Setup > Services Operations.

  2. Select TREE_CHANGE service operation name, and click the Search button.

  3. Click the TREE_CHANGE link.

  4. Click the Handlers tab from the General page, and enter a handler name.

  5. Select the On Notify option from the Type drop-down list.

  6. Select the Application Class option from the Implementation drop-down list.

  7. Click the Details link.

    The Handler Details page appears.

  8. Populate the required fields with data from the application package that you created.

Image: Handler Details page

This example illustrates the fields and controls on the Handler Details page populated with data from the application package.

Handler Details page

Note: There is a colon in the Path field.

To set full access to the corresponding permission list:

  1. Select PeopleTools > Integration Broker > Integration Setup > Services Operations.

  2. Select TREE_CHANGE service operation name, and click the Search button.

  3. Click the TREE_CHANGE link.

  4. In the General page, click the Service Operation Security link.

    The Web Service Access page appears.

  5. Set full access to corresponding permissions list, and click the Save button.

    Note: For additional security setting, check whether the permission list used for your user includes TREE_MAINT queue. Also, check whether TREE_MAINT queue has full access rights.

Image: Web Service Access page

This example illustrates the fields and controls on the Web Service Access page.

Web Service Access page

To test a TREE_CHANGE subscription process:

  1. Select Tree Manager, Tree Manager.

  2. Search for an existing tree and open it in the Tree Manager page.

  3. Change any tree and save it.

    Note: You can also use Save As functionality to create a new tree.

  4. Select PeopleTools > Integration Broker > Service Operations Monitor > Monitoring > Asynchronous Services.

  5. Select the Subscription Contracts tab.

  6. Select a node in the Node Names field.

  7. Select the TREE_CHANGE option from the Service Operation drop-down list.

  8. Select the TREE_MAINT option from the Queue Name drop-down list.

  9. Click the Refresh button.

    A list of service operations are displayed under your test subscription.

Image: Subscription Contracts page

This example illustrates the fields and controls on the Subscription Contracts page with the list of service operations received under test subscription.

Subscription Contracts page

When you click the Details link in the Results section of the Subscription Contracts page, the Asynchronous Details page appears.

Image: Asynchronous Details page

This example illustrates the fields and controls on the Asynchronous Details page.

Asynchronous Details page

Note: If a subscription PeopleCode test program is used as in previous example, you can view the file being generated (Windows OS) as a part of a test subscription class at e:\temp\subscription.txt.