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!
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