Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Jar validation for Schema user upload

gokul
Regular Contributor
Regular Contributor

Hi,

I need to perform validation through an external jar during the schema upload of users. I want to know how I should specify this in the SAV file. I have looked at the samples and in the MODIFYUSERDATAJSON, the class and method names are passed, but I need to know the exact format. Also, is COMPUTEDCOLUMNS mandatory even for jar validations?

Currently, I have used the following format. Please correct me if I am providing anything incorrectly:

#MODIFYUSERDATAJSON={
"COMPUTEDCOLUMNS" : ["USERNAME","FIRSTNAME","LASTNAME","EMAIL","PHONENUMBER","DEPARTMENTNUMBER","STARTDATE","ENDDATE","CUSTOMPROPERTY32","OWNER"],
"PREPROCESSQUERIES" : ["CUSTOMFUNCTION###FUNCTION1"],
"CUSTOMFUNCTIONS" : {
"FUNCTION1" : {
"FULLCLASSNAME" : "com.saviynt.custom.UserPreprocessValidator.validator.UserBulkCustomValidator",
"METHODNAME" : "validateOrganizationUserRule"
}
}
}

This is the final error that I got in the job log:
Error in Users Import - Error while processing data: No signature of method:
com.saviynt.custom.UserPreprocessValidator.validator.UserBulkCustomValidator.validateOrganizationUserRule()
is applicable for argument types:
(com.mysql.cj.jdbc.ConnectionImpl, java.util.HashMap) values:
[com.mysql.cj.jdbc.ConnectionImpl@2450bc23, ...]
Possible solutions:
validateOrganizationUserRule(java.lang.String)

Please help me here.

Regards,
Gokul

5 REPLIES 5

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @gokul 

could you please validate if the arguments passed to the method validateOrganizationUserRule are of correct type. What are you passing to this method and what is expected to be returned are they matching with the method definition. Please validate and confirm. 

 

Regards,

Dhruv Sharma

rushikeshvartak
All-Star
All-Star

It seems java method needs string as input 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

gokul
Regular Contributor
Regular Contributor

Hi @Dhruv_S  @rushikeshvartak 
For this method, I am passing the user list as a string, and I have also defined the return type as a string. This is the default method provided in the sample Saviynt bulk user upload validation source file. Also, it works fine when I perform an import through the UI.
public String validateOrganizationUserRule(String userListJson) {

String validatedresponse = gson.toJson(userDataList);
return validatedresponse;
}

Can you share full logs


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

gokul
Regular Contributor
Regular Contributor

To trigger the custom validation JAR in the Schema User Upload, we must use the predefined method and class name in the SAV file. By calling the method name `doCustomPreprocessValidation`, we can successfully perform the validation.
Reference Code - https://docs-be.saviyntcloud.com/bundle/SSM-Admin-v55x/page/Content/Resources/Attachments/Connection...

Note: We encountered an issue when using the same package name, class name, and method name. When created this way, regardless of the logic entered inside the method, it defaults to the logic specified in the sample. To resolve this, we changed the package name, and it then worked fine for us.