protected void deleteProcessDefinitions(DeleteProcessDefinitionsBuilder builder, boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) { if (skipCustomListeners) { builder = builder.skipCustomListeners(); } if (cascade) { builder = builder.cascade(); } if (skipIoMappings) { builder = builder.skipIoMappings(); } try { builder.delete(); } catch (NotFoundException e) { // rewrite status code from bad request (400) to not found (404) throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage()); } }
protected void deleteProcessDefinitions(DeleteProcessDefinitionsBuilder builder, boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) { if (skipCustomListeners) { builder = builder.skipCustomListeners(); } if (cascade) { builder = builder.cascade(); } if (skipIoMappings) { builder = builder.skipIoMappings(); } try { builder.delete(); } catch (NotFoundException e) { // rewrite status code from bad request (400) to not found (404) throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage()); } }
@Override public void deleteProcessDefinition(String processDefinitionId, boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) { DeleteProcessDefinitionsBuilder builder = deleteProcessDefinitions().byIds(processDefinitionId); if (cascade) { builder.cascade(); } if (skipCustomListeners) { builder.skipCustomListeners(); } if (skipIoMappings) { builder.skipIoMappings(); } builder.delete(); }
@Override public void deleteProcessDefinition(String processDefinitionId, boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) { DeleteProcessDefinitionsBuilder builder = deleteProcessDefinitions().byIds(processDefinitionId); if (cascade) { builder.cascade(); } if (skipCustomListeners) { builder.skipCustomListeners(); } if (skipIoMappings) { builder.skipIoMappings(); } builder.delete(); }
@Test public void testDeleteProcessDefinitionsByKeyWithIoMappingsSkipped() { // given testHelper.deploy(IO_MAPPING_PROCESS); runtimeService.startProcessInstanceByKey(IO_MAPPING_PROCESS_KEY); testHelper.deploy(IO_MAPPING_PROCESS); runtimeService.startProcessInstanceByKey(IO_MAPPING_PROCESS_KEY); // when repositoryService.deleteProcessDefinitions() .byKey(IO_MAPPING_PROCESS_KEY) .withoutTenantId() .cascade() .skipIoMappings() .delete(); List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list(); // then assertThat(processDefinitions.size(), is(0)); }
@Test public void testDeleteProcessDefinitionsByIdsWithIoMappingsSkipped() { // given testHelper.deploy(IO_MAPPING_PROCESS); runtimeService.startProcessInstanceByKey(IO_MAPPING_PROCESS_KEY); testHelper.deploy(IO_MAPPING_PROCESS); runtimeService.startProcessInstanceByKey(IO_MAPPING_PROCESS_KEY); String[] processDefinitionIds = findProcessDefinitionIdsByKey(IO_MAPPING_PROCESS_KEY); // when repositoryService.deleteProcessDefinitions() .byIds(processDefinitionIds) .cascade() .skipIoMappings() .delete(); List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list(); // then assertThat(processDefinitions.size(), is(0)); }
@Override public void deleteProcessDefinition(String processDefinitionId, boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) { DeleteProcessDefinitionsBuilder builder = deleteProcessDefinitions().byIds(processDefinitionId); if (cascade) { builder.cascade(); } if (skipCustomListeners) { builder.skipCustomListeners(); } if (skipIoMappings) { builder.skipIoMappings(); } builder.delete(); }
protected void deleteProcessDefinitions(DeleteProcessDefinitionsBuilder builder, boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) { if (skipCustomListeners) { builder = builder.skipCustomListeners(); } if (cascade) { builder = builder.cascade(); } if (skipIoMappings) { builder = builder.skipIoMappings(); } try { builder.delete(); } catch (NotFoundException e) { // rewrite status code from bad request (400) to not found (404) throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage()); } }
@Test public void testDeleteProcessDefinitionsByKeyWithIoMappingsSkipped() { // given testHelper.deploy(IO_MAPPING_PROCESS); runtimeService.startProcessInstanceByKey(IO_MAPPING_PROCESS_KEY); testHelper.deploy(IO_MAPPING_PROCESS); runtimeService.startProcessInstanceByKey(IO_MAPPING_PROCESS_KEY); // when repositoryService.deleteProcessDefinitions() .byKey(IO_MAPPING_PROCESS_KEY) .withoutTenantId() .cascade() .skipIoMappings() .delete(); List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list(); // then assertThat(processDefinitions.size(), is(0)); }
@Test public void testDeleteProcessDefinitionsByIdsWithIoMappingsSkipped() { // given testHelper.deploy(IO_MAPPING_PROCESS); runtimeService.startProcessInstanceByKey(IO_MAPPING_PROCESS_KEY); testHelper.deploy(IO_MAPPING_PROCESS); runtimeService.startProcessInstanceByKey(IO_MAPPING_PROCESS_KEY); String[] processDefinitionIds = findProcessDefinitionIdsByKey(IO_MAPPING_PROCESS_KEY); // when repositoryService.deleteProcessDefinitions() .byIds(processDefinitionIds) .cascade() .skipIoMappings() .delete(); List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list(); // then assertThat(processDefinitions.size(), is(0)); }