class SoMonitoringController {

    @GET
    @Path("/process-instance-id/{requestId}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response getProcessInstanceId(final @PathParam("requestId") String requestId) {
        if (requestId == null || requestId.isEmpty()) {
            return Response.status(Status.BAD_REQUEST).entity("Invalid Request id: " + requestId).build();
        }
        try {
            final Optional<ProcessInstanceIdDetail> processInstanceId =
                    camundaProcessDataServiceProvider.getProcessInstanceIdDetail(requestId);
            if (processInstanceId.isPresent()) {
                return Response.status(Status.OK).entity(processInstanceId.get()).build();
            }

            LOGGER.error("Unable to find process instance id for : {} ", requestId);
            return Response.status(Status.NO_CONTENT).build();

        } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
            final String message = "Unable to find process instance id for : " + requestId;
            LOGGER.error(message);
            return Response.status(Status.BAD_REQUEST).entity(message).build();
        } catch (final RestProcessingException restProcessingException) {
            final String message = "Unable to process request for id: " + requestId;
            LOGGER.error(message);
            return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
        }
    }

    @Autowired public  SoMonitoringController(final DatabaseServiceProvider databaseServiceProvider,
            final CamundaProcessDataServiceProvider camundaProcessDataServiceProvider);

}