Run Refresh Identity through Rule

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

Hi Team,

As part of requirement , We need to refresh identity through a rule with setting some parameters . What are the options to achieve this?

I would be great if we can lock the identity during this execution.

Thanks
Swathi

Hi Swati,
This code schedules identity refresh workflow execution in 5 seconds after code execution.

Date date = new Date();
    date.setTime(date.getTime() + 5000);
    
    Map<String, Object> launchArgsMap = new HashMap<>();
    
    launchArgsMap.put("identityName", identityName);
    launchArgsMap.put("workflow", "Identity Refresh");
    launchArgsMap.put("processTriggers", "true");
    launchArgsMap.put("promoteAttributes", "true");
    launchArgsMap.put("provision", "true");
    launchArgsMap.put("refreshIdentityEntitlements", "true");
    launchArgsMap.put("refreshManagerStatus", "true");
    launchArgsMap.put("refreshRoleMetadata", "true");
    launchArgsMap.put("synchronizeAttributes", "false");
    launchArgsMap.put("correlateEntitlements", "true");
    launchArgsMap.put("correlateScope", "true");
    launchArgsMap.put("disableIdentityProcessingThreshold", "true");
    
    RequestDefinition def = context.getObjectByName(RequestDefinition.class, "Workflow Request");
    Request request = new Request();
    request.setDefinition(def);
    request.setEventDate(date);
    request.setName("Identity Refresh: " + identityName);
    request.setAttributes(def, launchArgsMap);
    
    RequestManager.addRequest(context, request);
  }
2 Likes

in 5 seconds? so we are all refreshing right now?

nice.

Good one :wink: get ready for refresh :wink: let me be more correct

Edit:
@ipobeidi hope better now :wink:

3 Likes

Use below sample code

import sailpoint.api.Identitizer;
import sailpoint.object.Identity;
import sailpoint.object.Attributes;

String idenName="<Your User Name>";
Identity identity = context.getObjectByName(Identity.class, idenName);
Map map = new HashMap();
map.put("promoteAttributes",true);
map.put("refreshManagerStatus",true);
map.put("refreshIdentityEntitlements",true);

Attributes attr=new Attributes()
attr.setMap(map);

// Add any other attributes of refresh task , get the names from debug page
Identitizer identitizer = new Identitizer( context, map );  

identitizer.refresh(identity);


context.saveObject(identity);

context.commitTransaction();
7 Likes

Hi @SRchalla,

Have you tested the code provided by Satish?
If it answers your query, would you be so kind to mark Satish reply as solution?

This will help other users to quickly find the answer to your question if the have exactly the same question :slight_smile:

– Remold

2 Likes

it is showing error like below
Constructor error: Can’t find constructor: sailpoint.api.Identitizer(sailpoint.server.InternalContext, java.util.HashMap) in class: sailpoint.api.Identitizer :

@SindhujaGalam

Welcome to the Community.

Please use the updated code with Attributes.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.