Hi Everyone,
We are facing some issues for Access request, So sometimes when the user submit the access request it gets corrupted like it doesnt go for approval at all and end there itself or sometimes it goes for approval then it corrupts.
Any idea, if I can re-trigger the access request workflow via the rule for the corrupted request?
We are using IIQ version 8.3P3.
Ideally you should not be creating identity request by yourself. If it is failing, then you should re-request for the same. Also, if possible, please let us know the reason or share the logs which is causing request corruption.
But for the sake of use-case please find the below sample snippet by which you can create a new request from rule.
import sailpoint.api.RequestManager;
import sailpoint.object.Attributes;
import sailpoint.object.Identity;
import sailpoint.object.Request;
import sailpoint.object.RequestDefinition;
import sailpoint.object.Workflow;
import sailpont.tools.Util;
...
Map argsMap = new HashMap();
argsMap.put("identityName",identityName);
argsMap.put("plan", plan);
argsMap.put("launcher", "spadmin");
argsMap.put("notificationScheme", "none");
argsMap.put("approvalScheme", "none");
Workflow wf = (Workflow) context.getObjectByName(Workflow.class, "My WF");
RequestDefinition reqDef = context.getObjectByName(RequestDefinition.class, "Workflow Request");
Request req = new Request();
req.setDefinition(reqDef);
Attributes allArgs = new Attributes();
allArgs.put("workflow", "My WF");
allArgs.put("requestName", "Launched WF From Rule");
allArgs.putAll(argsMap);
req.setAttributes(reqDef, allArgs);
//Delay the launch by 5 minutes
Date launchDate = Util.incrementDateByMinutes(new Date(), 5);
req.setEventDate(launchDate);
Identity id = context.getObjectByName(Identity.class, "spadmin");
req.setOwner(id);
req.setName("Launched WF From Rule");
//Launch the workflow
RequestManager.addRequest(context, req);
context.decache(reqDef);
context.decache(id);