Share all details about your problem, including any error messages you may have received.
Hi All,
I have a custom requirement where i need to remove pending access requests for an identity. Can someone provide a snippet how to delete a pending identity request to try out in rule.
Pending IdentityRequest may have a workflowCase associated with it so you may want also look in to that and delete those workflow cases (any outstanding workItems will get deleted automatically).
Having said that here is the sample code:
Terminator terminator = new Terminator(context);
terminator.deleteObjects(IdentityRequest.class,
new QueryOptions(Filter.or(Filter.eq("targetId", identity.getId()),
Filter.eq("targetDisplayName",
identity.getDisplayName()))));
This will delete ALL Identity requests so you may want to throw in a filter to filter out the ones that are not finished.