class ManualHandlingTasks {

    public void completeTask(DelegateTask task) {

        DelegateExecution execution = task.getExecution();

        try {

            String taskId = task.getId();
            logger.debug("taskId is: " + taskId);
            TaskService taskService = execution.getProcessEngineServices().getTaskService();

            Map<String, Object> taskVariables = taskService.getVariables(taskId);
            String responseValue = (String) taskVariables.get(RESPONSE_VALUE);

            logger.debug("Received responseValue on completion: " + responseValue);
            // Have to set the first letter of the response to upper case
            String responseValueUppercaseStart =
                    responseValue.substring(0, 1).toUpperCase() + responseValue.substring(1);
            logger.debug("ResponseValue to taskListener: " + responseValueUppercaseStart);
            execution.setVariable(RESPONSE_VALUE_TASK, responseValueUppercaseStart);

        } catch (BpmnError e) {
            logger.debug(BPMN_EXCEPTION + e.getMessage());
            throw e;
        } catch (Exception ex) {
            String msg = "Exception in completeManualTask " + ex.getMessage();
            logger.debug(msg);
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
        }

    }

}