/* * Executes an action and returns the next. */ @Override public WorkflowActionConfig doState( Context c, EPerson user, HttpServletRequest request, int workflowItemId, Workflow workflow, WorkflowActionConfig currentActionConfig) throws SQLException, AuthorizeException, IOException, MessagingException, WorkflowException { try { XmlWorkflowItem wi = xmlWorkflowItemService.find(c, workflowItemId); Step currentStep = currentActionConfig.getStep(); if (currentActionConfig.getProcessingAction().isAuthorized(c, request, wi)) { ActionResult outcome = currentActionConfig.getProcessingAction().execute(c, wi, currentStep, request); return processOutcome( c, user, workflow, currentStep, currentActionConfig, outcome, wi, false); } else { throw new AuthorizeException("You are not allowed to to perform this task."); } } catch (WorkflowConfigurationException e) { log.error( LogManager.getHeader( c, "error while executing state", "workflow: " + workflow.getID() + " action: " + currentActionConfig.getId() + " workflowItemId: " + workflowItemId), e); WorkflowUtils.sendAlert(request, e); throw new WorkflowException(e); } }