Thanks for all your inputs.
@Puja_IAM @neel193 - plan.getArguments().put(“fieldName”, value); didn’t work.
@Peddapolu - Could you please explain how I can get access to the source inside Role Provisioning policy?
@pravin_ranjan - I tried this approach but still the request is expecting interaction from user to fill the form.
I’m using the below script to bulk assign the role. It will be a run rule task, iterates the csv file and launches LCM provisioning workflow for each user in the csv.
Identity id = context.getObjectByName(Identity.class, IdentityName);
ProvisioningPlan plan = new ProvisioningPlan();
plan.setIdentity(id);
plan.setSource("BulkRoleAssignmentFromExcel");
AccountRequest iiqReq = new AccountRequest(AccountRequest.Operation.Modify, "IIQ", null, id.getName());
iiqReq.add(new AttributeRequest("assignedRoles", ProvisioningPlan.Operation.Add, "Test Role"));
plan.getArguments().put("firstname", csvRow.getFirstName());
plan.getArguments().put("lastName", csvRow.getLastName());
plan.getArguments().put("email", csvRow.getEmail());
plan.getArguments().put("operatorType", csvRow.getOperator());
plan.getArguments().put("printers", csvRow.getPrinter());
plan.getArguments().put("functionLevels", csvRow.getFunctionalLevels());
plan.getArguments().put("userGroups", csvRow.getUserGroups());
plan.getArguments().put("enterpriseSecurity", csvRow.getEntrSecurity());
plan.add(iiqReq);
//Construct Workflow Arguments
Attributes wfArgs = new Attributes();
wfArgs.put("approvalScheme", "none"); // This skips the approval step
wfArgs.put("notificationScheme", "none");
wfArgs.put("source", "Batch_Upload_Task");
wfArgs.put("policyScheme", "none");
wfArgs.put("workflow", "LCM Provisioning");
wfArgs.put("launcher", "spadmin");
wfArgs.put("identityName", IdentityName);
wfArgs.put("plan", plan);
Workflow wf = (Workflow)context.getObjectByName(Workflow.class,"LCM Provisioning");
WorkflowLaunch wflaunch = new WorkflowLaunch();
wflaunch.setWorkflowName(wf.getName());
wflaunch.setWorkflowRef(wf.getName());
wflaunch.setCaseName("Batch_Upload_Task"+id.getName());
wflaunch.setVariables(wfArgs);
Workflower workflower = new Workflower(context);
WorkflowLaunch launch = workflower.launch(wflaunch);
After launching the workflow, I see the access request is generated but waiting for interaction to complete the form. I’ve tried setting the form values inside AttributeRequest as well but no luck.
Below is the screenshot of the pending request for user interaction.