Check if all approvers approved

Hi everyone,
given a certain change I need to check (when someone approves) if all the approvers approved.
Which is the java command to do that? Thanks!

Add Comment
2 Answer(s)
Best answer

You can add a post Event on Approve and iterate the workflow history checking if there is any other Awaiting Approval.

ITwoWayIterator iterator = object.getTable(.getTableIterator();
 while (iterator.hasNext()) {
 IRow row = (IRow) iterator.next();
 String action = row.getCell(ProgramConstants.ATT_WORKFLOW_ACTION).getValue().toString();
 String statusCode = row.getCell(ProgramConstants.ATT_WORKFLOW_STATUS_CODE).getValue().toString();
   if(action.equalsIgnoreCase("Awaiting Approval") && statusCode.contains("Current Process") ){
       //Awaiting Approver found. So Not all approvers approved
   }
 }

 Mind that if there is the autopromotion on current status, the event can be triggered in parallel with Change Status

Agile Angel Answered on December 11, 2015.
Add Comment

That’s great Antonio, that’s what I needed! Thank you 🙂

Agile User Answered on December 11, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.