class SDNCRequestTasks {

    public void processCallback(DelegateExecution execution) {
        try {
            SDNCRequest request = (SDNCRequest) execution.getVariable(SDNC_REQUEST);
            String asyncRequest = (String) execution.getVariable(request.getCorrelationName() + MESSAGE);

            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
            dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
            dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document doc = db.parse(new InputSource(new StringReader(asyncRequest)));

            String finalMessageIndicator = getXmlElement(doc, "/input/ack-final-indicator");

            boolean isCallbackCompleted = convertIndicatorToBoolean(finalMessageIndicator);
            execution.setVariable(IS_CALLBACK_COMPLETED, isCallbackCompleted);
            if (isCallbackCompleted) {
                String responseCode = getXmlElement(doc, "/input/response-code");
                if (!SDNC_SUCCESS.equalsIgnoreCase(responseCode)) {
                    String responseMessage;
                    try {
                        responseMessage = getXmlElement(doc, "/input/response-message");
                    } catch (Exception e) {
                        responseMessage = "Unknown Error in SDNC";
                    }
                    throw new SDNCErrorResponseException(responseMessage);
                }
            }
        } catch (SDNCErrorResponseException e) {
            logger.error("SDNC error response - " + e.getMessage());
            exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), ONAPComponents.SDNC);
        } catch (Exception e) {
            logger.error("Error processing SDNC callback", e);
            exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "Error processing SDNC callback",
                    ONAPComponents.SO);
        }
    }

}