class RollbackService extends ExternalTaskUtils {

    public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
        mdcSetup.setupMDC(externalTask);
        logger.trace("Executing External Task Rollback Service");
        Map<String, Object> variables = new HashMap<>();
        boolean success = false;
        boolean pollRollbackStatus = false;
        try {
            String xmlRequest = externalTask.getVariable("openstackAdapterTaskRequest");
            if (xmlRequest != null) {
                Optional<String> requestType = findRequestType(xmlRequest);
                if ("createVolumeGroupRequest".equals(requestType.get())) {
                    logger.debug("Executing External Task Rollback Service for Create Volume Group");
                    CreateVolumeGroupRequest req =
                            JAXB.unmarshal(new StringReader(xmlRequest), CreateVolumeGroupRequest.class);
                    vnfAdapterImpl.deleteVnf(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(),
                            req.getVolumeGroupName(), req.getMsoRequest(), false);
                    pollRollbackStatus = true;
                    success = true;
                } else if ("createVfModuleRequest".equals(requestType.get())) {
                    logger.debug("Executing External Task Rollback Service for Create Vf Module");
                    CreateVfModuleRequest req =
                            JAXB.unmarshal(new StringReader(xmlRequest), CreateVfModuleRequest.class);
                    vnfAdapterImpl.deleteVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(),
                            req.getVfModuleName(), req.getVnfId(), req.getVfModuleId(), req.getModelCustomizationUuid(),
                            req.getMsoRequest(), new Holder<>());
                    pollRollbackStatus = true;
                    success = true;
                } else if ("createNetworkRequest".equals(requestType.get())) {
                    logger.debug("Executing External Task Rollback Service for Create Network");
                    Holder<Boolean> networkDeleted = new Holder<>();
                    CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class);
                    networkAdapterImpl.deleteNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),
                            req.getModelCustomizationUuid(), req.getNetworkName(), req.getMsoRequest(), networkDeleted,
                            false);
                    pollRollbackStatus = true;
                    success = true;
                }
            }
        } catch (Exception e) {
            logger.error("Error during External Task Rollback Service", e);
        }
        variables.put("OpenstackRollbackSuccess", success);
        variables.put("rollbackPerformed", true);
        variables.put("PollRollbackStatus", pollRollbackStatus);
        if (success) {
            externalTaskService.complete(externalTask, variables);
            logger.debug("The External Task Id: {}  Successful", externalTask.getId());
        } else {
            logger.debug("The External Task Id: {}  Failed. Not Retrying", externalTask.getId());
            externalTaskService.complete(externalTask, variables);
        }
    }

}