if(request.getParameter("submit_reject") != null){
String reason = request.getParameter("reason");
if(reason == null || 0 == reason.trim().length()){
request.setAttribute("page", REJECT_PAGE);
addErrorField(request, "reason");
return new ActionResult(ActionResult.TYPE.TYPE_ERROR);
}
//We have pressed reject, so remove the task the user has & put it back to a workspace item
XmlWorkflowManager.sendWorkflowItemBackSubmission(c, wfi, c.getCurrentUser(), this.getProvenanceStartId(), reason);
return new ActionResult(ActionResult.TYPE.TYPE_SUBMISSION_PAGE);
}else{
//Cancel, go back to the main task page
request.setAttribute("page", MAIN_PAGE);
return new ActionResult(ActionResult.TYPE.TYPE_PAGE);
}
}