Before you can use the connector with your PeopleSoft application, you must:
This section describes:
This section describes required operations that must be performed when you use the connector to process application events. Perform this installation before you use the connector for the first time.
Installing event-processing components involves the following processes:
Running this file with the default values creates a Projects directory within the dependencies directory. The project name is CW_EVENT_Vx, where Vx identifies the version number.
To build the event and archive tables and the function library:
INSERT INTO PS_FUNCLIB_CW (CW_EVENT_NOT) VALUES ('0');
To build the CW_EVENT_CI API files (required when the connector processes only events) or the Component Interface API files (required when the connector processes both events and requests):
$ProductDirS/connectors/PeopleSoft/dependencies
%ProductDirS%\connectors\PeopleSoft\dependencies
The adapter includes the cw_publish_events() function in the FUNCLIB_CW function library. This function inserts events into the connector's event table. This section describes the function and the sample code that calls it.
The cw_publish_events() function takes four parameters, all of type String:
Using the values specified for its parameters and the information currently available in the Component Buffer, the function gathers the required information from the Component and inserts the event in the event table. The function performs the following:
The adapter includes a sample of the PeopleCode declaration and function call in the savepostchg.txt file in the connector's samples directory. Replace the business object's name and keys with the correct information for your business object and then copy and paste the code directly into the PeopleCode editor.
Before making the actual function call, use a simple logic test to verify that the Record or Component actually changed. If it did not change, the connector does not call the function, which enhances performance. Also verify that the %userid is not CW. Doing so prevents the connector from interpreting a data change from a request as a new application event.
The following code is the sample that the adapter provides:
/* Place this code in Component's SavePostChg() and define the four */ /* parameters used in the function call */ Declare Function cw_publish_event PeopleCode FUNCLIB_CW.CW_EVENT_NOT FieldFormula; Component String &BONAME1; Component STring &KEYLIST1; Component String &CWPRIORITY1; Component String &CONNID1; &BONAME1 ="Psft_Dept"; &KEYLIST1 = "DEPT_TBL.SetId:DEPT_TBL.DeptId"; &CWPRIORITY = 2; &CONNID1 ="PeopleSoftConnector"; /* Check if Component Changed before calling function */ If ComponentChanged() and %userid <> "CW" then /* Publish this event to the IBM WebSphere CW_EVENT_TBL for polling */ cw_publish_event(&BONAME1,&KEYLIST1,&CWPRIORITY1,&CONNID1); End-if;
The connector uses the event table to poll events for pickup. For each event, the connector gets the business object's name, verb, and key from the event table. The connector uses this information to retrieve the entire entity from the application. If the entity was changed after the event was first logged, the connector gets the initial event and all subsequent changes. In other words, if an entity is created and updated before the connector gets it from the event table, the connector gets both data changes in the single retrieval.
The following three outcomes are possible for each event processed by a connector:
If events are not deleted from the event table after the connector picks them up, they occupy unnecessary space there. However, if they are deleted, all events that are not processed are lost and event-processing cannot be audited. Therefore, the adapter provides the archive table to store events deleted from the event table.
Table 3 describes the columns in the event and archive tables.
Table 3. Event and archive table schema
Name | Description | Type | Constraint |
---|---|---|---|
CW_EVENT_ID | Internal identifier of the event A unique key field that identifies each event generated from within PeopleSoft | NUMBER | Primary key |
CW_CONNECTOR_ID | Unique ID of the connector for which the event is destined. This value is important when multiple connectors poll the same table. | VARCHAR | |
CW_OBJ_KEYS | Keys of the business object, specified in name-value format. When defining parameters for a function call (such as cw_publish_events), the name consists of the table name and field name separated by a period. Multiple keys are separated with a colon or other configurable delimiter, for example: DEPT_TBL.SetId:DEPT_TBL.DeptIdFor more information, see "EventKeyDelimiter". | VARCHAR | Not null |
CW_OBJ | Name of the business object | VARCHAR | Not null |
CW_VERB | Verb associated with the event. A PeopleCode function included with the adapter determines the value (Create, Retrieve, Update, Delete) based upon the %Mode system variable used by PeopleSoft | VARCHAR | Not null |
CW_PRIORITY | Event priority (0 is highest, n is lowest), which the connector uses to get events on a priority basis. | NUMBER | Not null |
CW_DTTM | Date and time the event or archiving occurred | STRING | Default current date/time (for archive table, actual event time). PeopleSoft treats the datatype for DATE fields as STRING and returns the same. |
CW_STATUS | -2 (Error sending event to integration broker) | VARCHAR | Not null |
-1 (Error processing event) | |||
0 (Ready for poll) | |||
1 (Sent to integration broker) | |||
2 (No Subscriptions for the business object) | |||
3 (In Progress). This status is used only in the event table and not in the archive table. |