Writing a PeopleCode Program for use with PeopleSoft Events
For the PeopleSoft Adapter's outbound transactions, you use the PeopleCode Editor to create a PeopleCode program for use with the component's SavePreChange or SavePostChange event. PeopleSoft calls SavePreChange events before any database updates and calls SavePostChange events after any database updates.
For an overview of how the
PeopleSoft Adapter uses PeopleCode programs, see
PeopleSoft-to-webMethods Communications. For more details on PeopleCode events, see your PeopleSoft documentation.
To create a PeopleCode Program that sends a message to the node
1. Start the PeopleSoft Application Designer. You must use the PeopleSoft Application Designer to view, edit, or create PeopleCode.
2. Open the component that has the request message attached to the SavePreChange or Save PostChange event.
3. View the PeopleCode for the selected component. See your PeopleSoft documentation if you need instructions on using the PeopleCode Editor.
4. If you are using PeopleTools versions 8.41, 8.42, 8.43, 8.44, 8.45, 8.46, or 8.47, select the event (for example, SavePostChange), and type the following code in the PeopleCode Editor:
Local Message &request, &response;
Local Rowset &rep;
&rep = GetLevel0();
&request = CreateMessage(Message.REP_SYNC);
&request.CopyRowsetDelta(&rep);
&response = &request.SyncRequest(Node.WEBM_NODE);
where REP_SYNC is the name of the request message and WEBM_NODE is the node representing the Integration Server.
5. If you are using PeopleTools version 8.48 or 8.49, select the event (for example, SavePostChange), and type the following code in the PeopleCode Editor:
Local Message &request, &response;
Local Rowset &rep;
&rep = GetLevel0();
&request = CreateMessage(Operation.WEBM_SO);
&request.CopyRowsetDelta(&rep);
&response = %IntBroker.SyncRequest(&request, Node.WEBM_NODE);
where WEBM_SO is the name of the service operation and WEBM_NODE is the node representing the Integration Server.
6. Click the Save.