@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(); }
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()); } }
@Test public void testDeleteProcessDefinitionsByKeyWithCustomListenersSkipped() { // given IncrementCounterListener.counter = 0; for (int i = 0; i < 3; i++) { deployTwoProcessDefinitions(); } runtimeService.startProcessInstanceByKey("processOne"); // when repositoryService.deleteProcessDefinitions() .byKey("processOne") .withoutTenantId() .cascade() .skipCustomListeners() .delete(); // then assertThat(IncrementCounterListener.counter, is(0)); }
@Test public void testDeleteProcessDefinitionsByIdsWithCustomListenersSkipped() { // given IncrementCounterListener.counter = 0; for (int i = 0; i < 3; i++) { deployTwoProcessDefinitions(); } String[] processDefinitionIds = findProcessDefinitionIdsByKey("processOne"); runtimeService.startProcessInstanceByKey("processOne"); // when repositoryService.deleteProcessDefinitions() .byIds(processDefinitionIds) .cascade() .skipCustomListeners() .delete(); // then assertThat(IncrementCounterListener.counter, is(0)); }
@Test public void testDeleteDefinitionsByKeySkipCustomListenersWithTenantId() { given() .pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY) .pathParam("tenant-id", MockProvider.EXAMPLE_TENANT_ID) .queryParam("skipCustomListeners", true) .expect() .statusCode(Status.NO_CONTENT.getStatusCode()) .when() .delete(SINGLE_PROCESS_DEFINITION_BY_KEY_AND_TENANT_ID_DELETE_URL); DeleteProcessDefinitionsBuilder builder = repositoryServiceMock.deleteProcessDefinitions() .byKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY) .withTenantId(MockProvider.EXAMPLE_TENANT_ID) .skipCustomListeners(); verify(builder).delete(); }
@Test public void testDeleteDefinitionsByKeySkipCustomListenersAndCascadeWithTenantId() { given() .pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY) .queryParam("skipCustomListeners", true) .queryParam("cascade", true) .pathParam("tenant-id", MockProvider.EXAMPLE_TENANT_ID) .expect() .statusCode(Status.NO_CONTENT.getStatusCode()) .when() .delete(SINGLE_PROCESS_DEFINITION_BY_KEY_AND_TENANT_ID_DELETE_URL); DeleteProcessDefinitionsBuilder builder = repositoryServiceMock.deleteProcessDefinitions() .byKey(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY) .withTenantId(MockProvider.EXAMPLE_TENANT_ID) .skipCustomListeners() .cascade(); verify(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(); }
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 testDeleteProcessDefinitionsByIdsWithCustomListenersSkipped() { // given IncrementCounterListener.counter = 0; for (int i = 0; i < 3; i++) { deployTwoProcessDefinitions(); } String[] processDefinitionIds = findProcessDefinitionIdsByKey("processOne"); runtimeService.startProcessInstanceByKey("processOne"); // when repositoryService.deleteProcessDefinitions() .byIds(processDefinitionIds) .cascade() .skipCustomListeners() .delete(); // then assertThat(IncrementCounterListener.counter, is(0)); }
@Test public void testDeleteProcessDefinitionsByKeyWithCustomListenersSkipped() { // given IncrementCounterListener.counter = 0; for (int i = 0; i < 3; i++) { deployTwoProcessDefinitions(); } runtimeService.startProcessInstanceByKey("processOne"); // when repositoryService.deleteProcessDefinitions() .byKey("processOne") .withoutTenantId() .cascade() .skipCustomListeners() .delete(); // then assertThat(IncrementCounterListener.counter, is(0)); }