private Response<WorkflowState> state(String componentId, String id) { try { return Response.forPayload(storage.workflowState(WorkflowId.create(componentId, id))); } catch (IOException e) { return Response .forStatus(Status.INTERNAL_SERVER_ERROR.withReasonPhrase("Couldn't fetch state.")); } }
return Response.forStatus(Status.NOT_FOUND.withReasonPhrase("Could not find workflow.")); final WorkflowState workflowState = storage.workflowState(workflowId); if (!workflowState.nextNaturalTrigger().isPresent()) { return Response.forStatus(Status.NOT_FOUND.withReasonPhrase("No next natural trigger for workflow."));