There is no javascript extension that gives you actual approver (as shown in request log (PROCESSLOG table)) .
So if you need to retrieve the actual approver you will need to use the workflow Java APIs - a good place to do that is in the postscript of the Activity.
Here is sample code to show how you can use the APIs (need to be made available in scriptframework.properties) :
if (activity.resultSummary == activity.TIMEOUT) {
approvalFlag.set("TIMEOUT");
activity.setResult(activity.TIMEOUT, "Escalation timeout");
} else if (activity.resultSummary != activity.FAILED) {
if (activity.resultSummary == activity.APPROVED) {
approvalFlag.set("APPROVED");
} else if (activity.resultSummary == activity.REJECTED) {
approvalFlag.set("REJECTED");
}
//Instantiate java variables
procId = java.lang.Long(process.id);
processMgr = new com.ibm.itim.workflow.model.ProcessManager()
a = new com.ibm.itim.workflow.model.Activity();
ae = new com.ibm.itim.workflow.model.ActivityEntity(a);
myParticipant = com.ibm.itim.workflow.model.ActivityParticipant();
myEventAudit = com.ibm.itim.workflow.model.CompleteManualActivityEventAudit(myParticipant);
//Give them some real values to work with
thisProcess = processMgr.getProcess(procId);
approvedLoopIndex.set(loopcount);
ae = thisProcess.getActivity("ManagerApproval", loopcount);
eve ae.getHistory();
Enrole.log("MANAGERAPPROVAL POSTSCRIPT", "EVENTSIZE: " + events.size());
//get the approver
for ( i = events.size() -1; i >= 0; i--) {
event = events.get(i);
eventType = event.getEventType();
Enrole.log("MANAGERAPPROVAL POSTSCRIPT", "Event " + i + ": " + eventType);
// change event to CompleteManualActivityEventAudit
myEventAudit = event;
//There are several eventTypes - please check the APIDOC https://www.stephen-swann.co.uk/javadoc/tim5.0/com/ibm/itim/workflow/model/EventAudit.html
if (eventType == com.ibm.itim.workflow.model.EventAudit.COMPLETE_MANUAL_ACTIVITY) {
approver_name = myEventAudit.getParticipant().getId();
approverName.set(approver_name);
Enrole.log("MANAGERAPPROVAL POSTSCRIPT", "IN COMPLETE_MANUAL_ACTIVITY: Approver name: " + approver_name);
} else if (eventType == com.ibm.itim.workflow.model.EventAudit.ACTIVITY_ASSIGNMENT_CHANGED) {
lastParticipantUid = myEventAudit.getParticipant().getId();
searchFilter = "(uid=" + lastParticipantUid + ")";
personSearch = new PersonSearch();
searchResults = personSearch.searchByFilter("SKE Person", searchFilter);
if (searchResults.length > 0)
{
approver_dn = searchResults[0].dn;
approverDN.set(approver_dn);
approverName.set(new Person(approver_dn).getProperty("cn")[0]);
Enrole.log("MANAGERAPPROVAL POSTSCRIPT", "IN ACTIVITY_ASSIGNMENT_CHANGED: Approver name: " + approverName.get());
}
}
}
}
____________________________________________
As mentioned in the code you should be careful with the eventTypes - you can chck the PROCESS/PROCESSLOG/ACTIVITY tables (probably the data is embedded in some XML document - I do not remember exactly how and where it is stored) but you should be able to find out relatively easily...
HTH - and let me know if you need additional help...
------------------------------
Franz Wolfhagen
WW IAM Consulting Leader - Certified Consulting IT Specialist
IBM Security Expert Labs
------------------------------