Thursday, May 22, 2014

Near Real-time integration without customization

I was speaking with a former colleague, who works at another PeopleSoft shop about integrating current employee's with their talent management system, basically populating current employee demographic data, so they don't have to populate this information when they apply for an internal position.  He told me that he was handed a design that required a nightly batch process to run and identify the changes and send them via integration broker.  

This got us talking about ways to do more real time integration without customizing.  And I shared with him how we use the delivered PERSON_BASIC_SYNC to integrate with our business continuity system, AlertFind.  Our approach was to piggyback off the delivered asynchronous message to generate a synchronous message to AlertFind.

 First you have to make sure you message is active and that you have security defined.


Next you have to configure a Local to Local routing.


Then you need to write a Handler to parse the Local to Local message to get the employee that you are wanting to process out of the message.

This is our Handler:

import ZZ_AF_SEND:UpdateUser;
import PS_PT:Integration:INotificationHandler;



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

method PersonSync_AlertFind
end-method;

method OnNotify
   /+ &_MSG as Message +/
   /+ Extends/implements PS_PT:Integration:INotificationHandler.OnNotify +/
   
   Local string &PubNodeName, &LocalNodeName;
   Local Record &idmQueue = CreateRecord(Record.ZZ_IDM_QUEUE);
   Local Record &idmData = CreateRecord(Record.ZZ_IDM);
   
   
   /* process only if message was published on the local node with the INTERNAL version */
   &PubNodeName = &_MSG.PubNodeName;
   SQLExec(SQL.EO_SEL_LOCALNODE, &LocalNodeName);
   If &LocalNodeName = &PubNodeName Then
      
      
      Local string &Emplid;
      &Emplid = &_MSG.GetRowset().GetRow(1).PERSON.EMPLID.Value;
      
      &idmData.EMPLID2.Value = &Emplid;
      &idmData.ZZ_REC_TYPE.Value = "C";
      If &idmData.SelectByKey() Then
         Local ZZ_AF_SEND:UpdateUser &AlertFind = create ZZ_AF_SEND:UpdateUser();
         &AlertFind.arrayOfUsers = CreateArray(&Emplid);
         &AlertFind.Execute();
      End-If;

      
   End-If;
   
end-method;


The handler above instantiates an UpdateUser that takes an array of employee ids, this package handles the message creation and the integration broker call to publish the update, this package is not shown in this blog posting.  

Then configure your handler to be active within the PERSON_BASIC_SYNC.


  This approach is basically asynchronous to synchronous approach that gives our organization near real-time integration with our Business Continuity tool, AlertFind.

No comments:

Post a Comment