Case 2: A Nonrowset-Based Message Exists in PeopleSoft Interaction Hub for the Same-Name Service Operation in PeopleSoft HCM

Examples of these service operations are ones used by the Resource Finder feature where the service operation is defined with a rowset-based message in PeopleSoft HCM but uses a nonrowset-based message in PeopleSoft Interaction Hub, such as COMPANY_FULLSYNC, DEPT_FULLSYNC, LOCATION_FULLSYNC, PERSON_BASIC_FULLSYNC. To leverage the PeopleSoft subscription utilities which process rowset-based transactions:

  1. Create a rowset-based message in PIA (this message will be used in the handler PeopleCode.

  2. Because the message needs to be assigned to a default service operation, create a “dummy” service and service operation of the same name for the message (no routing and handler need to be defined).

    For example, for the Company business data integration, use COMPANY_FULLSYNC_RS VERSION_1 as there is already a message with the name COMPANY_FULLSYNC VERSION_1

  3. Insert this message name in string variable &sMsgName and the version in &sMsgVer in the sample code below.

Peoplecode examples are provided below for full synchronization and incremental synchronization.

Full Synchronization

The following sample is for full synchronization:

/* Start of sample code */
import PS_PT:Integration:INotificationHandler;

class CompanyFullSync implements PS_PT:Integration:INotificationHandler
   method CompanyFullSync();
   method OnNotify(&_MSG As Message);
end-class;

Declare Function Subscribe_FullReplication PeopleCode FUNCLIB_EOEIP.SUBSCRIBE_MSG_PC FieldFormula;
Declare Function Delete_Existing_Data PeopleCode FUNCLIB_EOEIP.SUBSCRIBE_MSG_PC FieldFormula;

/* constructor */
method CompanyFullSync
end-method;

method OnNotify
   /+ &_MSG as Message +/
   /+ Extends/implements PS_PT:Integration:INotificationHandler.OnNotify +/
   /* Variable Declaration */
   
   Local Message &msg;
   Local Rowset &msgRowset;
   Local XmlDoc &inXMLDoc;
   Local boolean &ret;
   Local string &sMsgName = "<insert rowset-based message name>";
   Local string &sMsgVer = "<insert message version>";
   
   /* instantiate variable for rowset-based message */
   &msg = CreateMessage(@("Message." | &sMsgName));
   &msgRowset = &msg.GetRowset();
   
   /* substitute incoming XML root name to rowset-based message name */
   &inXMLDoc = &_MSG.GetXmlDoc();
   &inXMLDoc.DocumentElement.NodeName = &sMsgName;
   
   /* copy XML to message rowset */
   &ret = &inXMLDoc.CopyToRowset(&msgRowset, &sMsgName, &sMsgVer);
   
   /* call library function to update table */
   Evaluate &msgRowset(1).PSCAMA.MSG_SEQ_FLG.Value
   When "H"
      /* If the current message is the header msg, then prepare the table for insert */
      Delete_Existing_Data(&msg);
      Break;
   When "T"
      rem ********** put code for cleanup here *******************;
      Break;
   When-Other
      Subscribe_FullReplication(&msg);
      Break;
   End-Evaluate;
end-method;

/* End of sample code */

Incremental Synchronization

The following sample is for full synchronization:

/* Start of sample code */
import PS_PT:Integration:INotificationHandler;
class CompanySync implements PS_PT:Integration:INotificationHandler
   method CompanySync ();
   method OnNotify(&_MSG As Message);
end-class;
Declare Function Subscribe_IncrReplication PeopleCode FUNCLIB_EOEIP.SUBSCRIBE_MSG_PC FieldFormula;
/* constructor */
method CompanySync
end-method;
method OnNotify
   /+ &_MSG as Message +/
   /+ Extends/implements PS_PT:Integration:INotificationHandler.OnNotify +/
   /* Variable Declaration */

   Local Message &msg; 
   Local Rowset &msgRowset;
   Local XmlDoc &inXMLDoc;
   Local boolean &ret;
   Local string &sMsgName = "<insert rowset-based message name>";
   Local string &sMsgVer = "<insert message version>";
   
   /* instantiate variable for rowset-based message */
   &msg = CreateMessage(@("Message." | &sMsgName));
   &msgRowset = &msg.GetRowset();
   
   /* substitute incoming XML root name to rowset-based message name */
   &inXMLDoc = &_MSG.GetXmlDoc();
   &inXMLDoc.DocumentElement.NodeName = &sMsgName;
   
   /* copy XML to message rowset */
   &ret = &inXMLDoc.CopyToRowset(&msgRowset, &sMsgName, &sMsgVer);

   Subscribe_IncrReplication(&msg);
   end-method;
/* End  of sample code */