class RequestHandlerUtils extends AbstractRestHandler {

    public boolean camundaHistoryCheck(InfraActiveRequests duplicateRecord, InfraActiveRequests currentActiveReq)
            throws RequestDbFailureException, ContactCamundaException {
        String requestId = duplicateRecord.getRequestId();
        ResponseEntity<List<HistoricProcessInstanceEntity>> response = null;
        try {
            response = camundaRequestHandler.getCamundaProcessInstanceHistory(requestId, true, true, false);
        } catch (RestClientException e) {
            logger.error("Error querying Camunda for process-instance history for requestId: {}, exception: {}",
                    requestId, e.getMessage());
            ContactCamundaException contactCamundaException =
                    new ContactCamundaException.Builder("process-instance", requestId, e.toString(),
                            HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e)
                                    .build();
            updateStatus(currentActiveReq, Status.FAILED, contactCamundaException.getMessage());
            throw contactCamundaException;
        }

        if (response.getBody().isEmpty()) {
            updateStatus(duplicateRecord, Status.COMPLETE, "Request Completed");
        } else {
            return true;
        }
        return false;
    }

}