It depends on which type of certification you are using.
If it is Targeted Certification, you don’t need to use Pre-Delegation Rule as you can have this conditions in certifier Rule itself unless you need to have delegation.
Pre-Delegation Rule
You need to return a Map as output of the Rule
Map results = new HashMap();
String workGroupname = "test workgroup";
You will have certification object as one of the inputs, from which you can get certifier using below code snippet.
String certifierName = certification.getCertifiers().get(0);
Alternatively you can get from CertificationEntity object as well, which is also an input.
String certifierName = entity.getIdentity();
Build Identity object for certifier
Identity certifierObj = context.getObjectByName(Identity.class, certifierName);
Check status
boolean status = certifierObj.isInactive();
if (!status) {
results.put("recipientName", certifierName );
} else {
results.put("recipientName", workGroupname );
}
You can add some description and comments
results.put("description", "Please certify your own access");
results.put("comments", "This is the access currently granted to you: ");
You need set one more argument reassign: (Boolean) flag indicating whether this is a reassignment or delegation (true=>reassignment).
The difference between reassignment and delegation is that reassigned certifications do not return to the original certifier for review and approval when the assignee has completed signoff and delegated items do.
results.put("reassign", true);
return results;
Certifier Rule
Just Return certifierName as output.
boolean status = certifierObj.isInactive();
if (!status) {
return certifierName;
} else {
return workGroupname;
}
Thanks
Krish