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.
This example shows 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:
Select
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.
This example shows an application class that is used to subscribe to TREE_CHANGE service operation (1 of 2).

This example shows an application class that is used to subscribe to TREE_CHANGE service operation (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:
Select
The search page appears.
Select TREE_CHANGE service operation name, and click the Search button.
Click the TREE_CHANGE link.
The General page appears.
On the General page, select the Generate Local-to-Local option.
Local-to-local routing is auto-generated.
This example illustrates the fields and controls on the General page - Service Operation.

Use the Handlers page to create a service operation handler.
Navigation:
This example illustrates the fields and controls on the Handlers page - Service Operation.

To create a service operation handler:
Select
Select TREE_CHANGE service operation name, and click the Search button.
Click the TREE_CHANGE link.
Click the Handlers tab from the General page, and enter a handler name.
Select the On Notify option from the Type drop-down list.
Select the Application Class option from the Implementation drop-down list.
Click the Details link.
The Handler Details page appears.
Populate the required fields with data from the application package that you created.
This example illustrates the fields and controls on the Handler Details page populated with data from the application package.

Note: There is a colon in the Path field.
To set full access to the corresponding permission list:
Select
Select TREE_CHANGE service operation name, and click the Search button.
Click the TREE_CHANGE link.
In the General page, click the Service Operation Security link.
The Web Service Access page appears.
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.
This example illustrates the fields and controls on the Web Service Access page.

To test a TREE_CHANGE subscription process:
Select Tree Manager, Tree Manager.
Search for an existing tree and open it in the Tree Manager page.
Change any tree and save it.
Note: You can also use Save As functionality to create a new tree.
Select
Select the Subscription Contracts tab.
Select a node in the Node Names field.
Select the TREE_CHANGE option from the Service Operation drop-down list.
Select the TREE_MAINT option from the Queue Name drop-down list.
Click the Refresh button.
A list of service operations are displayed under your test subscription.
This example illustrates the fields and controls on the Subscription Contracts page with the list of service operations received under test subscription.

When you click the Details link in the Results section of the Subscription Contracts page, the Asynchronous Details page appears.
This example illustrates the fields and controls on the 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.