if(submitButton.startsWith("submit_select_reviewer_")){
//Retrieve the identifier of the eperson which will do the reviewing
int reviewerId = Integer.parseInt(submitButton.substring(submitButton.lastIndexOf("_") + 1));
EPerson reviewer = EPerson.find(c, reviewerId);
//We have a reviewer, assign him, the workflowitemrole will be translated into a task in the autoassign
WorkflowItemRole workflowItemRole = WorkflowItemRole.create(c);
workflowItemRole.setEPerson(reviewer);
workflowItemRole.setRoleId(getRoleId());
workflowItemRole.setWorkflowItemId(wfi.getID());
workflowItemRole.update();
return new ActionResult(ActionResult.TYPE.TYPE_OUTCOME, ActionResult.OUTCOME_COMPLETE);
}
//There are only 2 active buttons on this page, so if anything else happens just return an error
return new ActionResult(ActionResult.TYPE.TYPE_ERROR);