I have a use case where after IIQ creates an account for a target connector there is an application support team that wants a work item assigned to them for additional steps they need to perform to complete the full access for the end user.
If it possible to fulfill this through an after provisioning rule? Does anyone have a sample rule they can share?
You would probably want to keep the rule thin: identify the account Create, check the relevant provisioning result where present, then launch a small workflow that creates the work item for the support workgroup.
The workflow would then be the place to handle assignment, notifications, escalation, and completion. If you would like it to run asynchronously, RequestManager is worth considering.
If the follow-up should only happen once the connector reports the create as completed, you would want to use Committed rather than Queued.
This work item would definitely only be assigned once the account creation is completed. Do you have an example on how I would script that with the code provided by Neel?
Building on @neel193’s snippet, since you only want this once the account Create comes back committed, I would add the check before the launch and let the async part run through RequestManager
for (AccountRequest ar : plan.getAccountRequests()) {
if (AccountRequest.Operation.Create.equals(ar.getOperation())) {
ProvisioningResult pr = ar.getResult();
if (pr == null) {
pr = plan.getResult();
}
if (pr != null &&
ProvisioningResult.STATUS_COMMITTED.equals(pr.getStatus())) {
String workflowName = "Create Support WorkItem";
long launchTime = System.currentTimeMillis() + 5000;
String caseName = "Post-Provisioning Task: "
+ ar.getApplicationName() + " (" + launchTime + ")";
Attributes reqArgs = new Attributes();
reqArgs.put(StandardWorkflowHandler.ARG_REQUEST_DEFINITION,
WorkflowRequestExecutor.DEFINITION_NAME);
reqArgs.put(StandardWorkflowHandler.ARG_WORKFLOW, workflowName);
reqArgs.put(StandardWorkflowHandler.ARG_REQUEST_NAME, caseName);
Attributes wfArgs = new Attributes();
if (plan.getIdentity() != null) {
wfArgs.put("identityName", plan.getIdentity().getName());
}
wfArgs.put("applicationName", ar.getApplicationName());
wfArgs.put("nativeIdentity", ar.getNativeIdentity());
reqArgs.putAll(wfArgs);
RequestDefinition reqDef =
context.getObject(RequestDefinition.class, "Workflow Request");
Request req = new Request();
req.setDefinition(reqDef);
req.setEventDate(new Date(launchTime));
req.setName(caseName);
req.setAttributes(reqDef, reqArgs);
RequestManager.addRequest(context, req);
}
}
}
The Committed check should keep it from launching for a merely Queued result, preferring the specific AccountRequest result where the connector provides one and falling back to the plan-level result otherwise. The idea would be for the Create Support WorkItem workflow to accept identityName, applicationName, and nativeIdentity and create the support work item there.
On the imports, the wildcards @neel193 listed cover most of this. Since AccountRequest is a nested class, you would still need:
Ok. So if I pull together everything you all have shared I attached the rule in theory I would be testing. Let me know your thoughts and I will do some testing. Rule-After Provisioning-Assign WorkItem.xml (3.5 KB)
@talbright So, you’ll schedule a workflow to launch separately and in the workflow you need to write a code to create workitem. so basically you need to create two artefacts: one after provisioning rule and other is the workflow to create the workitems.