class ApplicationControllerTask extends ExternalTaskUtils {

    protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
        mdcSetup.setupMDC(externalTask);
        ApplicationControllerTaskRequest request = externalTask.getVariable("appcOrchestratorRequest");
        String msoRequestId = externalTask.getVariable("mso-request-id");
        logger.debug("Starting External Task for RequestId: {} ", msoRequestId);
        Status status = null;
        ApplicationControllerCallback listener =
                new ApplicationControllerCallback(externalTask, externalTaskService, applicationControllerSupport);

        try {
            status = applicationControllerTaskImpl.execute(msoRequestId, request, listener);
            if (status != null && status.getCode() != 0
                    && !applicationControllerSupport.getCategoryOf(status).equals(StatusCategory.NORMAL)) {
                logger.error("The External Task Id: {} Failed locally with status {}", externalTask.getId(),
                        status.getMessage());
                externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", status.getMessage());
            }
        } catch (Exception e) {
            logger.error("The External Task Id: {} Failed while calling appc with exception", externalTask.getId(),
                    e.getMessage());
            externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", e.getMessage());
        }
    }

}