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

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

4 REPLIES 4

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 you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

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 you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.