Quantcast
Channel: SCN : Document List - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 571

PI.SFSF Integration.DOC – Successfactors communication channel supports UDF based Lookups. [SFSF Lookup]

$
0
0

Document Objective: Objective of this document is to providing information about that “SFSF SOAP Channel supports for UDF based Lookups”.

 

This document provides an example on implementation of SFSF lookup UDF in PI Enterprise Service Repository.

 

 

Connectivity add on1.0
PatchLastest sca files :PICOASUF and PIADAPTERS.sca
Entity Type:SOAP
Entity Name:User
Operation TypeQuery
LookUp QuerySelect id from User where externalId in (<dynamicValues>)

 

 

 

Brief about Technical Scenario:

For each person_id_external Lookup Query will bring back the id from SFSF User Entity.

E.g. Input <external-Id > 346 and Output < id > would be USR-22.

 

 

Step I. Include following packages.

2.PNG

 

 

Step II. add UDF with following paramters.

3.png

 

Step III. UDF Code.

 

AbstractTrace trace = container.getTrace();

String Var_Username ="";

for (int inlen = 0; inlen < Var_ExternalID.length; inlen++)

{

Var_Username = Var_Username+","+"'"+Var_ExternalID[inlen]+"'";

}

Var_Username = Var_Username.substring(1,Var_Username.length());

 

try

  {

Payload SOAPOutPayload = null;

String SysName ="";

String BuisnessSysName ="";

BuisnessSysName = "SUCCESS_FACTORS_DEV";

Channel channel = LookupService.getChannel( BuisnessSysName,"Common_SF_SFAPI_Receiver");

SystemAccessor accessor = LookupService.getSystemAccessor(channel);

String SOAPxml ="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:query
xmlns:ns0=\"urn:sfobject.sfapi.successfactors.com\"><ns0:queryString>Select id,externalId from User where externalId in ( "+Var_Username+")</ns0:queryString></ns0:query>";

 

InputStream inputStream =new ByteArrayInputStream(SOAPxml.getBytes());

XmlPayload payload = LookupService.getXmlPayload(inputStream);

SOAPOutPayload = accessor.call(payload);

InputStream inp = SOAPOutPayload.getContent();

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder builder = factory.newDocumentBuilder();

Document document = builder.parse(inp);

document.getDocumentElement().normalize();

NodeList list = document.getElementsByTagName("id");

NodeList Elist = document.getElementsByTagName("externalId");

for (int temp =0; temp < list.getLength(); temp++)

{

Node node = list.item(temp);

Node Enode = Elist.item(temp);

if (node != null)

{

node = node.getFirstChild();

Enode = Enode.getFirstChild();

if (node != null)

{

result.addValue(node.getNodeValue()+"||"+Enode.getNodeValue());

}

}

}

}

catch (Exception e)

{

trace.addWarning("Error" + e);

  result.addValue(e);

}

 

Step IV: Communication Channel.

9.png

 

Step V : Testing and UDF Execution

4.PNG

5.PNG

6.png

Request Message to Successfactors

7.png

Response back from Successfactors

 

8.png

 

Please do write back your comments and Queries. 


Viewing all articles
Browse latest Browse all 571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>