We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Get secondary Manager based on managerial level

mansoorahmed1
New Contributor
New Contributor

I have peculiar use case need Ideas on how to implement this in Saviynt.

Every users who are getting imported will have a field call managerial level (ex 1,2,3,4,5,6,7,8 where 1-5 is top level ).

Use Case:

Update User's Seondary manager field with Manager who is in level 5.

Requirement:  

Check the User’s managerial Level.If it is 5 then set the current User’s DN,  

If it is more than 5 (i.e. 6, 7 or 8), then find the Manager’s Manager and check their managerial level until managerial level 5 is reached. 

If the reporting Manager’s managerial level is less than 5 (i.e 4, 3, 2 or 1), leave the field blank 

How can I achieve this ? Only through external jar file by calling the Java method ? I tried using preprocessor queries but couldnt do the recursive search in SQL query .

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

Use external Jar & manipulate logic and use updateuser api from jar


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

mansoorahmed1
New Contributor
New Contributor

Any sample java method ? Not sure how to call these two tables(current and newusers table) within the Jar .

 

{
  "ADDITIONALTABLES": {
    "USERS": "SELECT username,location,EMPLOYEECLASS,CUSTOMPROPERTY6,MIDDLENAME,SYSTEMUSERNAME from USERS ",
    "ENTITLEMENT_VALUES": "SELECT entitlementtypekey,customproperty1,customproperty2,customproperty3,customproperty4,customproperty5,customproperty6,customproperty7,entitlement_value FROM ENTITLEMENT_VALUES where entitlementtypekey in  (224,240)"
  },
  "COMPUTEDCOLUMNS": [
    "CUSTOMPROPERTY1",
    "CITY",
    "COUNTRY",
    "CUSTOMPROPERTY2",
    "CUSTOMPROPERTY3",
    "STATE",
    "STREET",
    "CUSTOMPROPERTY4",
    "CUSTOMPROPERTY6",
    "SYSTEMUSERNAME"
  ],
  "TABLEINDEXES": {
    "currentusers": [
      "username",
      "location",
      "EMPLOYEECLASS"
    ],
    "CURRENTENTITLEMENT_VALUES": [
      "entitlementtypekey",
      "entitlement_value"
    ]
  },
  "PREPROCESSQUERIES": [
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.CUSTOMPROPERTY1=(select CURRENTENTITLEMENT_VALUES.customproperty1 from CURRENTENTITLEMENT_VALUES where CURRENTENTITLEMENT_VALUES.entitlementtypekey=240 and CURRENTENTITLEMENT_VALUES.entitlement_value =NEWUSERDATA.LOCATION) ",
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.CITY=(select CURRENTENTITLEMENT_VALUES.customproperty2 from CURRENTENTITLEMENT_VALUES where CURRENTENTITLEMENT_VALUES.entitlementtypekey=240 and CURRENTENTITLEMENT_VALUES.entitlement_value =NEWUSERDATA.LOCATION) ",
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.COUNTRY=(select CURRENTENTITLEMENT_VALUES.customproperty3 from CURRENTENTITLEMENT_VALUES where CURRENTENTITLEMENT_VALUES.entitlementtypekey=240 and CURRENTENTITLEMENT_VALUES.entitlement_value =NEWUSERDATA.LOCATION) ",
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.CUSTOMPROPERTY2=(select CURRENTENTITLEMENT_VALUES.customproperty4 from CURRENTENTITLEMENT_VALUES where CURRENTENTITLEMENT_VALUES.entitlementtypekey=240 and CURRENTENTITLEMENT_VALUES.entitlement_value =NEWUSERDATA.LOCATION) ",
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.CUSTOMPROPERTY3=(select CURRENTENTITLEMENT_VALUES.customproperty5 from CURRENTENTITLEMENT_VALUES where CURRENTENTITLEMENT_VALUES.entitlementtypekey=240 and CURRENTENTITLEMENT_VALUES.entitlement_value =NEWUSERDATA.LOCATION) ",
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.STATE=(select CURRENTENTITLEMENT_VALUES.customproperty6 from CURRENTENTITLEMENT_VALUES where CURRENTENTITLEMENT_VALUES.entitlementtypekey=240 and CURRENTENTITLEMENT_VALUES.entitlement_value =NEWUSERDATA.LOCATION) ",
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.STREET=(select CURRENTENTITLEMENT_VALUES.customproperty7 from CURRENTENTITLEMENT_VALUES where CURRENTENTITLEMENT_VALUES.entitlementtypekey=240 and CURRENTENTITLEMENT_VALUES.entitlement_value =NEWUSERDATA.LOCATION) ",
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.CUSTOMPROPERTY4=(select CURRENTENTITLEMENT_VALUES.entitlement_value from CURRENTENTITLEMENT_VALUES where CURRENTENTITLEMENT_VALUES.entitlementtypekey=224 and CURRENTENTITLEMENT_VALUES.customproperty1 LIKE CONCAT('%', NEWUSERDATA.LOCATION, '%')and CURRENTENTITLEMENT_VALUES.customproperty2 LIKE CONCAT('%', NEWUSERDATA.EMPLOYEECLASS, '%')) ",
    "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.CUSTOMPROPERTY6 = case when  CURRENTUSERS.CUSTOMPROPERTY6 is not null and CURRENTUSERS.CUSTOMPROPERTY6 != '' then CURRENTUSERS.CUSTOMPROPERTY6 when (CURRENTUSERS.CUSTOMPROPERTY6 IS NULL or CURRENTUSERS.CUSTOMPROPERTY6 = '') AND (NEWUSERDATA.MIDDLENAME IS NOT NULL and NEWUSERDATA.MIDDLENAME != '') THEN CONCAT(CONCAT(UPPER(SUBSTRING(NEWUSERDATA.firstname,1,1)),LOWER(SUBSTRING(NEWUSERDATA.firstname,2))),' ',UPPER(SUBSTRING(NEWUSERDATA.middlename,1,1)),'.',' ',CONCAT(UPPER(SUBSTRING(NEWUSERDATA.lastname,1,1)),LOWER(SUBSTRING(NEWUSERDATA.lastname,2)))) WHEN (CURRENTUSERS.CUSTOMPROPERTY6 IS NULL or CURRENTUSERS.CUSTOMPROPERTY6='') AND (NEWUSERDATA.MIDDLENAME IS  NULL or NEWUSERDATA.MIDDLENAME ='') THEN CONCAT(CONCAT(UPPER(SUBSTRING(NEWUSERDATA.firstname,1,1)),LOWER(SUBSTRING(NEWUSERDATA.firstname,2))),' ',CONCAT(UPPER(SUBSTRING(NEWUSERDATA.lastname,1,1)),LOWER(SUBSTRING(NEWUSERDATA.lastname,2)))) end",
    "CUSTOMFUNCTION###FUNCTION1"
  ],
  "CUSTOMFUNCTIONS": {
    "FUNCTION1": {
      "FULLCLASSNAME": "com.saviynt.utility.Transformation",
      "METHODNAME": "doCustomPreprocess"
    }
  }
}

 

You need call custom jar 

You must package the custom java code in a Jar file. A sample Java file is provided for your reference. Compile the Jar file using Java Development Kit (JDK) 1.7 or 1.8. You have to package the custom java code in the JAR file and upload the JAR file to make it available to EIC for further processing. You can upload the JAR file from the File Directory page in EIC. For more information, see Managing the External Jar Files.

https://docs.saviyntcloud.com/bundle/EIC-Admin-v24x/page/Content/Chapter03-User-Management/User-Impo...

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.