test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/repository/ProcessDefinitionResourceTest.java
test_class.identifier: ProcessDefinitionResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" })
      public void testActivateProcessDefinition() throws Exception {
          ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
          repositoryService.suspendProcessDefinitionById(processDefinition.getId());
  
          processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
          assertThat(processDefinition.isSuspended()).isTrue();
  
          ObjectNode requestNode = objectMapper.createObjectNode();
          requestNode.put("action", "activate");
  
          HttpPut httpPut = new HttpPut(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_DEFINITION, processDefinition.getId()));
          httpPut.setEntity(new StringEntity(requestNode.toString()));
          CloseableHttpResponse response = executeRequest(httpPut, HttpStatus.SC_OK);
  
          // Check "OK" status
          JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
          closeResponse(response);
          assertThatJson(responseNode)
                  .when(Option.IGNORING_EXTRA_FIELDS)
                  .isEqualTo("{"
                          + "suspended: false"
                          + "}");
  
          // Check if process-definition is suspended
          processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
          assertThat(processDefinition.isSuspended()).isFalse();
      }
test_case.class_method_signature: ProcessDefinitionResourceTest.testActivateProcessDefinition()
test_case.full_signature: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public void testActivateProcessDefinition()
test_case.identifier: testActivateProcessDefinition
test_case.invocations: singleResult createProcessDefinitionQuery suspendProcessDefinitionById getId singleResult createProcessDefinitionQuery isTrue assertThat isSuspended createObjectNode put createRelativeResourceUrl getId setEntity toString executeRequest readTree getContent getEntity closeResponse isEqualTo when assertThatJson singleResult createProcessDefinitionQuery isFalse assertThat isSuspended
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 testActivateProcessDefinition()
focal_class.declarator: processEngineConfiguration
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected ProcessEngineConfigurationImpl processEngineConfiguration;
focal_class.type: ProcessEngineConfigurationImpl
focal_class.var_name: processEngineConfiguration
focal_class.declarator: processMigrationService
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected ProcessMigrationService processMigrationService;
focal_class.type: ProcessMigrationService
focal_class.var_name: processMigrationService
focal_class.declarator: formRepositoryService
focal_class.modifier: @Autowired(required=false)
      protected
focal_class.original_string: @Autowired(required=false)
      protected FormRepositoryService formRepositoryService;
focal_class.type: FormRepositoryService
focal_class.var_name: formRepositoryService
focal_class.declarator: formHandlerRestApiInterceptor
focal_class.modifier: @Autowired(required=false)
      protected
focal_class.original_string: @Autowired(required=false)
      protected FormHandlerRestApiInterceptor formHandlerRestApiInterceptor;
focal_class.type: FormHandlerRestApiInterceptor
focal_class.var_name: formHandlerRestApiInterceptor
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ProcessDefinitionResource.java
focal_class.identifier: ProcessDefinitionResource
focal_class.class_method_signature: ProcessDefinitionResource.getProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Get a process definition", tags = { "Process Definitions" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates request was successful and the process-definitions are returned"), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found.") }) @GetMapping(value = "/repository/process-definitions/{processDefinitionId}", produces = "application/json") public ProcessDefinitionResponse getProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId, HttpServletRequest request)
focal_class.identifier: getProcessDefinition
focal_class.modifiers: @ApiOperation(value = "Get a process definition", tags = { "Process Definitions" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates request was successful and the process-definitions are returned"), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found.") }) @GetMapping(value = "/repository/process-definitions/{processDefinitionId}", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId, HttpServletRequest request)
focal_class.return: ProcessDefinitionResponse
focal_class.signature: ProcessDefinitionResponse getProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId, HttpServletRequest request)
focal_class.class_method_signature: ProcessDefinitionResource.executeProcessDefinitionAction(
              @ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @ApiParam(required = true) @RequestBody ProcessDefinitionActionRequest actionRequest,
              HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Execute actions for a process definition", tags = { "Process Definitions" }, notes = "Execute actions for a process definition (Update category, Suspend or Activate)") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates action has been executed for the specified process. (category altered, activate or suspend)"), @ApiResponse(code = 400, message = "Indicates no category was defined in the request body."), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found."), @ApiResponse(code = 409, message = "Indicates the requested process definition is already suspended or active.") }) @PutMapping(value = "/repository/process-definitions/{processDefinitionId}", produces = "application/json") public ProcessDefinitionResponse executeProcessDefinitionAction(
              @ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @ApiParam(required = true) @RequestBody ProcessDefinitionActionRequest actionRequest,
              HttpServletRequest request)
focal_class.identifier: executeProcessDefinitionAction
focal_class.modifiers: @ApiOperation(value = "Execute actions for a process definition", tags = { "Process Definitions" }, notes = "Execute actions for a process definition (Update category, Suspend or Activate)") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates action has been executed for the specified process. (category altered, activate or suspend)"), @ApiResponse(code = 400, message = "Indicates no category was defined in the request body."), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found."), @ApiResponse(code = 409, message = "Indicates the requested process definition is already suspended or active.") }) @PutMapping(value = "/repository/process-definitions/{processDefinitionId}", produces = "application/json") public
focal_class.parameters: (
              @ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @ApiParam(required = true) @RequestBody ProcessDefinitionActionRequest actionRequest,
              HttpServletRequest request)
focal_class.return: ProcessDefinitionResponse
focal_class.signature: ProcessDefinitionResponse executeProcessDefinitionAction(
              @ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @ApiParam(required = true) @RequestBody ProcessDefinitionActionRequest actionRequest,
              HttpServletRequest request)
focal_class.class_method_signature: ProcessDefinitionResource.getProcessDefinitionStartForm(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Get a process definition start form", tags = { "Process Definitions" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates request was successful and the process definition form is returned"), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found.") }) @GetMapping(value = "/repository/process-definitions/{processDefinitionId}/start-form", produces = "application/json") public String getProcessDefinitionStartForm(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId, HttpServletRequest request)
focal_class.identifier: getProcessDefinitionStartForm
focal_class.modifiers: @ApiOperation(value = "Get a process definition start form", tags = { "Process Definitions" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates request was successful and the process definition form is returned"), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found.") }) @GetMapping(value = "/repository/process-definitions/{processDefinitionId}/start-form", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId, HttpServletRequest request)
focal_class.return: String
focal_class.signature: String getProcessDefinitionStartForm(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId, HttpServletRequest request)
focal_class.class_method_signature: ProcessDefinitionResource.migrateInstancesOfProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @RequestBody String migrationDocumentJson, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Migrate all instances of process definition", tags = { "Process Definitions" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates process instances were found and migration was executed."), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found.") }) @PostMapping(value = "/repository/process-definitions/{processDefinitionId}/migrate", produces = "application/json") public void migrateInstancesOfProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @RequestBody String migrationDocumentJson, HttpServletRequest request)
focal_class.identifier: migrateInstancesOfProcessDefinition
focal_class.modifiers: @ApiOperation(value = "Migrate all instances of process definition", tags = { "Process Definitions" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates process instances were found and migration was executed."), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found.") }) @PostMapping(value = "/repository/process-definitions/{processDefinitionId}/migrate", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @RequestBody String migrationDocumentJson, HttpServletRequest request)
focal_class.return: void
focal_class.signature: void migrateInstancesOfProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @RequestBody String migrationDocumentJson, HttpServletRequest request)
focal_class.class_method_signature: ProcessDefinitionResource.batchMigrateInstancesOfProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @RequestBody String migrationDocumentJson, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Batch migrate all instances of process definition", tags = { "Process Definitions" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates process instances were found and batch migration was started."), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found.") }) @PostMapping(value = "/repository/process-definitions/{processDefinitionId}/batch-migrate", produces = "application/json") public void batchMigrateInstancesOfProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @RequestBody String migrationDocumentJson, HttpServletRequest request)
focal_class.identifier: batchMigrateInstancesOfProcessDefinition
focal_class.modifiers: @ApiOperation(value = "Batch migrate all instances of process definition", tags = { "Process Definitions" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates process instances were found and batch migration was started."), @ApiResponse(code = 404, message = "Indicates the requested process definition was not found.") }) @PostMapping(value = "/repository/process-definitions/{processDefinitionId}/batch-migrate", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @RequestBody String migrationDocumentJson, HttpServletRequest request)
focal_class.return: void
focal_class.signature: void batchMigrateInstancesOfProcessDefinition(@ApiParam(name = "processDefinitionId") @PathVariable String processDefinitionId,
              @RequestBody String migrationDocumentJson, HttpServletRequest request)
focal_class.class_method_signature: ProcessDefinitionResource.getStartForm(ProcessDefinition processDefinition)
focal_class.full_signature: protected FormInfo getStartForm(ProcessDefinition processDefinition)
focal_class.identifier: getStartForm
focal_class.modifiers: protected
focal_class.parameters: (ProcessDefinition processDefinition)
focal_class.return: FormInfo
focal_class.signature: FormInfo getStartForm(ProcessDefinition processDefinition)
focal_class.class_method_signature: ProcessDefinitionResource.activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_class.full_signature: protected ProcessDefinitionResponse activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_class.identifier: activateProcessDefinition
focal_class.modifiers: protected
focal_class.parameters: (ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_class.return: ProcessDefinitionResponse
focal_class.signature: ProcessDefinitionResponse activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_class.class_method_signature: ProcessDefinitionResource.suspendProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_class.full_signature: protected ProcessDefinitionResponse suspendProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_class.identifier: suspendProcessDefinition
focal_class.modifiers: protected
focal_class.parameters: (ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_class.return: ProcessDefinitionResponse
focal_class.signature: ProcessDefinitionResponse suspendProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_class.superclass: extends BaseProcessDefinitionResource
focal_method.body: protected ProcessDefinitionResponse activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date) {
  
          if (!repositoryService.isProcessDefinitionSuspended(processDefinition.getId())) {
              throw new FlowableConflictException("Process definition with id '" + processDefinition.getId() + " ' is already active");
          }
          repositoryService.activateProcessDefinitionById(processDefinition.getId(), suspendInstances, date);
  
          ProcessDefinitionResponse response = restResponseFactory.createProcessDefinitionResponse(processDefinition);
  
          // No need to re-fetch the ProcessDefinition, just alter the suspended
          // state of the result-object
          response.setSuspended(false);
          return response;
      }
focal_method.class_method_signature: ProcessDefinitionResource.activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_method.full_signature: protected ProcessDefinitionResponse activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_method.identifier: activateProcessDefinition
focal_method.invocations: isProcessDefinitionSuspended getId getId activateProcessDefinitionById getId createProcessDefinitionResponse setSuspended
focal_method.modifiers: protected
focal_method.parameters: (ProcessDefinition processDefinition, boolean suspendInstances, Date date)
focal_method.return: ProcessDefinitionResponse
focal_method.signature: ProcessDefinitionResponse activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date)