test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/history/HistoricProcessInstanceResourceTest.java
test_class.identifier: HistoricProcessInstanceResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" })
      public void testGetProcessInstance() throws Exception {
          ProcessInstance processInstance = runtimeService.createProcessInstanceBuilder()
                  .processDefinitionKey("oneTaskProcess")
                  .businessKey("myBusinessKey")
                  .callbackId("testCallbackId")
                  .callbackType("testCallbackType")
                  .referenceId("testReferenceId")
                  .referenceType("testReferenceType")
                  .start();
  
          CloseableHttpResponse response = executeRequest(
                  new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE, processInstance.getId())),
                  HttpStatus.SC_OK);
  
          assertThat(response.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
  
          JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
          closeResponse(response);
          assertThat(responseNode).isNotNull();
          assertThatJson(responseNode)
                  .when(Option.IGNORING_EXTRA_FIELDS)
                  .isEqualTo("{"
                          + "id: '" + processInstance.getId() + "',"
                          + "businessKey: 'myBusinessKey',"
                          + "callbackId: 'testCallbackId',"
                          + "callbackType: 'testCallbackType',"
                          + "referenceId: 'testReferenceId',"
                          + "referenceType: 'testReferenceType'"
                          + "}");
  
          Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
          assertThat(task).isNotNull();
          taskService.complete(task.getId());
  
          response = executeRequest(
                  new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE, processInstance.getId())),
                  HttpStatus.SC_NO_CONTENT);
          assertThat(response.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT);
          closeResponse(response);
      }
test_case.class_method_signature: HistoricProcessInstanceResourceTest.testGetProcessInstance()
test_case.full_signature: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public void testGetProcessInstance()
test_case.identifier: testGetProcessInstance
test_case.invocations: start referenceType referenceId callbackType callbackId businessKey processDefinitionKey createProcessInstanceBuilder executeRequest createRelativeResourceUrl getId isEqualTo assertThat getStatusCode getStatusLine readTree getContent getEntity closeResponse isNotNull assertThat isEqualTo when assertThatJson getId singleResult processInstanceId createTaskQuery getId isNotNull assertThat complete getId executeRequest createRelativeResourceUrl getId isEqualTo assertThat getStatusCode getStatusLine closeResponse
test_case.modifiers: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetProcessInstance()
focal_class.declarator: restResponseFactory
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected RestResponseFactory restResponseFactory;
focal_class.type: RestResponseFactory
focal_class.var_name: restResponseFactory
focal_class.declarator: historyService
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected HistoryService historyService;
focal_class.type: HistoryService
focal_class.var_name: historyService
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceResource.java
focal_class.identifier: HistoricProcessInstanceResource
focal_class.class_method_signature: HistoricProcessInstanceResource.getProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Get a historic process instance", tags = { "History Process" }, nickname = "getHistoricProcessInstance") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates that the historic process instances could be found."), @ApiResponse(code = 404, message = "Indicates that the historic process instances could not be found.") }) @GetMapping(value = "/history/historic-process-instances/{processInstanceId}", produces = "application/json") public HistoricProcessInstanceResponse getProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request)
focal_class.identifier: getProcessInstance
focal_class.modifiers: @ApiOperation(value = "Get a historic process instance", tags = { "History Process" }, nickname = "getHistoricProcessInstance") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates that the historic process instances could be found."), @ApiResponse(code = 404, message = "Indicates that the historic process instances could not be found.") }) @GetMapping(value = "/history/historic-process-instances/{processInstanceId}", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request)
focal_class.return: HistoricProcessInstanceResponse
focal_class.signature: HistoricProcessInstanceResponse getProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request)
focal_class.class_method_signature: HistoricProcessInstanceResource.deleteProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = " Delete a historic process instance", tags = { "History Process" }, nickname = "deleteHistoricProcessInstance") @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates that the historic process instance was deleted."), @ApiResponse(code = 404, message = "Indicates that the historic process instance could not be found.") }) @DeleteMapping(value = "/history/historic-process-instances/{processInstanceId}") public void deleteProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletResponse response)
focal_class.identifier: deleteProcessInstance
focal_class.modifiers: @ApiOperation(value = " Delete a historic process instance", tags = { "History Process" }, nickname = "deleteHistoricProcessInstance") @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates that the historic process instance was deleted."), @ApiResponse(code = 404, message = "Indicates that the historic process instance could not be found.") }) @DeleteMapping(value = "/history/historic-process-instances/{processInstanceId}") public
focal_class.parameters: (@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletResponse response)
focal_class.superclass: extends HistoricProcessInstanceBaseResource
focal_method.body: @ApiOperation(value = "Get a historic process instance", tags = { "History Process" }, nickname = "getHistoricProcessInstance")
      @ApiResponses(value = {
              @ApiResponse(code = 200, message = "Indicates that the historic process instances could be found."),
              @ApiResponse(code = 404, message = "Indicates that the historic process instances could not be found.") })
      @GetMapping(value = "/history/historic-process-instances/{processInstanceId}", produces = "application/json")
      public HistoricProcessInstanceResponse getProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request) {
          HistoricProcessInstanceResponse processInstanceResponse = restResponseFactory.createHistoricProcessInstanceResponse(getHistoricProcessInstanceFromRequest(processInstanceId));
          
          ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processInstanceResponse.getProcessDefinitionId()).singleResult();
          
          if (processDefinition != null) {
              processInstanceResponse.setProcessDefinitionName(processDefinition.getName());
              processInstanceResponse.setProcessDefinitionDescription(processDefinition.getDescription());
          }
          
          return processInstanceResponse;
      }
focal_method.class_method_signature: HistoricProcessInstanceResource.getProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request)
focal_method.full_signature: @ApiOperation(value = "Get a historic process instance", tags = { "History Process" }, nickname = "getHistoricProcessInstance") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates that the historic process instances could be found."), @ApiResponse(code = 404, message = "Indicates that the historic process instances could not be found.") }) @GetMapping(value = "/history/historic-process-instances/{processInstanceId}", produces = "application/json") public HistoricProcessInstanceResponse getProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request)
focal_method.identifier: getProcessInstance
focal_method.invocations: createHistoricProcessInstanceResponse getHistoricProcessInstanceFromRequest singleResult processDefinitionId createProcessDefinitionQuery getProcessDefinitionId setProcessDefinitionName getName setProcessDefinitionDescription getDescription
focal_method.modifiers: @ApiOperation(value = "Get a historic process instance", tags = { "History Process" }, nickname = "getHistoricProcessInstance") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates that the historic process instances could be found."), @ApiResponse(code = 404, message = "Indicates that the historic process instances could not be found.") }) @GetMapping(value = "/history/historic-process-instances/{processInstanceId}", produces = "application/json") public
focal_method.parameters: (@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request)
focal_method.return: HistoricProcessInstanceResponse
focal_method.signature: HistoricProcessInstanceResponse getProcessInstance(@ApiParam(name = "processInstanceId") @PathVariable String processInstanceId, HttpServletRequest request)