class ResponseHandler {

    public void acceptedOrNoContentResponse(ResponseEntity<String> response) throws BPMNFailureException {
        int status = setStatus(response.getStatusCodeValue());
        if (status != HttpStatus.SC_NO_CONTENT && status != HttpStatus.SC_ACCEPTED) {
            logger.info("Camunda did not return a valid response");
            throw new BPMNFailureException.Builder(String.valueOf(status), HttpStatus.SC_INTERNAL_SERVER_ERROR,
                    ErrorNumbers.ERROR_FROM_BPEL).build();
        }
    }

}