Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

rest connector import failing with CONST

iam01
Regular Contributor
Regular Contributor

We found out that whenever we try to use any CONST statement in the import user json, we are facing this issue. Once we remove all CONST statement all user records got imported.

The users get imported with all #CONST statements when we try to import users from ADP(individual users). However, when we try to import bulk users with pagination configured, the data is not importing and no error logs.

We removed all #const and then tried to import users and all users were successfully imported.

 

I found a similar post:

https://forums.saviynt.com/t5/identity-governance/sap-successfactor-pagination-not-working/m-p/33893

11 REPLIES 11

pruthvi_t
Saviynt Employee
Saviynt Employee

Hi @iam01 ,

Greetings.

Can you please share your importuser json. 

Also can you please try to run the call through postman and see if the result is same with pagination. Kindly share your findings as well.

Thanks,


Regards,
Pruthvi

iam01
Regular Contributor
Regular Contributor

Hi, 

 

Without pagination the API will give 100 users per request. I have removed the pagination block from import json all 100 users got imported with CONST values. 

The moment I add back the pagination, all (5000) users got imported expect the fields with CONST.

I don't think it's with problem with api response, because complete user data is getting imported for the fields with direct mapping and the field with CONST operator it's failing to import when pagination is added in import json.

pruthvi_t
Saviynt Employee
Saviynt Employee

@iam01 ,

Thank you for elaborating the scenario, as requested above, can you please provide the import user json which you're trying with and facing the issue.

Please make sure you're not sharing any sensitive information like URLs, credentials etc (if any).

Thanks, 


Regards,
Pruthvi

iam01
Regular Contributor
Regular Contributor

PFA @pruthvi_t 

pruthvi_t
Saviynt Employee
Saviynt Employee

Hi @iam01 ,

For using #CONST# keyword in colstoProps mapping for REST Connector, it is recommended to use it for hardcoded mapping to customproperty and smaller groovy based functions like replace, concatenate etc.

Using it in code to iterate through objects and mapping fields, it is recommended to use the User Import Preprocessor. This is to ensure that we need not evaluate repeated code for similar attributes while mapping them to multiple custom properties or fields.

You can even make use of custom jar to achieve this in case you're using a complex iterations.

Thanks,


Regards,
Pruthvi

iam01
Regular Contributor
Regular Contributor

@pruthvi_t  there is some complex iteration which we can't achive from import preprocessor. 

We have taken Saviynt REST documentation as reference for this implementation and it was mentioned in saviynt documentation to use the same code for complex implementation.

Saviynt documentation referred:

Support for storing the objectList data based on the condition specified in the colsToPropsMap attribute for user, account, and access import using #CONST# in the JSON

https://docs.saviyntcloud.com/bundle/REST-v2022x/page/Content/Developers-Handbook.htm

 

As I mentioned earlier, the CONST code is working without pagination block, successfully processing 100 records at a time. If am not wrong it's a bug and same issue was reported and one of the saviynt engineer confirmed it as bug.

 

pFA 

https://forums.saviynt.com/t5/identity-governance/sap-successfactor-pagination-not-working/m-p/33893

pruthvi_t
Saviynt Employee
Saviynt Employee

@iam01 ,

For the variables where CONST is being used, please try to define the variable as mentioned below and see if it works. 

"employeeid": "#CONST#<%List responseList = response.workAssignments; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if(dataMap.primaryIndicator){return  dataMap.payrollFileNumber}else if(count == size){return null}}%>~#~char",

Embed the login in <%...%>

Thanks,

Regards,
Pruthvi

JB
Regular Contributor
Regular Contributor

@pruthvi_t  As mentioned above we have tried running user import job by adding <% %> but it is not importing any users. Please find the below screenshot of Job history.

JB_0-1695752075879.png

 

pruthvi_t
Saviynt Employee
Saviynt Employee

@iam01 ,

Can you please let us know the business requirement for variables where CONST is being used so that we can check if this can be achieved through User import preprocessor.

Thanks,


Regards,
Pruthvi

JB
Regular Contributor
Regular Contributor

@pruthvi_t  Please find the attached sample of postman response. Under worker assignment can have more than one worker record and we have to take one with primary set to true, that's the reason we have used CONST here. 

Note :I have modified the name and address phone number details from actual value.

Regards,

JB

pruthvi_t
Saviynt Employee
Saviynt Employee

@JB , Usage of CONST for so many variables with complex iteration in the JSON uses up most of the jvm memory which results in the pods going down. This causes the import job to fail and affects the overall performance of the application.

Because the memory allocated to JVM is dynamic, multiple processes uses this memory in addition. So please try to use user import preprocessor to modify your data according to your case. If you feel it is not possible to use preprocessor then another option you could explore is through the custom jar.

Thanks,


Regards,
Pruthvi