本文整理了Java中org.camunda.bpm.engine.RepositoryService.deleteProcessDefinition
方法的一些代码示例,展示了RepositoryService.deleteProcessDefinition
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RepositoryService.deleteProcessDefinition
方法的具体详情如下:
包路径:org.camunda.bpm.engine.RepositoryService
类名称:RepositoryService
方法名:deleteProcessDefinition
[英]Deletes the process definition which belongs to the given process definition id. Same behavior as RepositoryService#deleteProcessDefinition(java.lang.String,boolean,boolean)Both boolean parameters of this method are per default false. The deletion is in this case not cascading.
[中]删除属于给定流程定义id的流程定义。与RepositoryService#deleteProcessDefinition(java.lang.String,boolean,boolean)的行为相同。此方法的两个布尔参数都默认为false。在这种情况下,删除不是级联的。
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public Response deleteProcessDefinition(boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) {
RepositoryService repositoryService = engine.getRepositoryService();
try {
repositoryService.deleteProcessDefinition(processDefinitionId, cascade, skipCustomListeners, skipIoMappings);
} catch (NotFoundException nfe) {
throw new InvalidRequestException(Status.NOT_FOUND, nfe, nfe.getMessage());
}
return Response.ok().build();
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public Response deleteProcessDefinition(boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) {
RepositoryService repositoryService = engine.getRepositoryService();
try {
repositoryService.deleteProcessDefinition(processDefinitionId, cascade, skipCustomListeners, skipIoMappings);
} catch (NotFoundException nfe) {
throw new InvalidRequestException(Status.NOT_FOUND, nfe, nfe.getMessage());
}
return Response.ok().build();
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteNonExistingProcessDefinition() {
// declare expected exception
thrown.expect(NotFoundException.class);
thrown.expectMessage("No process definition found with id 'notexist': processDefinition is null");
repositoryService.deleteProcessDefinition("notexist");
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteProcessDefinitionNullId() {
// declare expected exception
thrown.expect(NullValueException.class);
thrown.expectMessage("processDefinitionId is null");
repositoryService.deleteProcessDefinition(null);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeploymentThrowsAuthorizationException() {
String message = "expected exception";
doThrow(new AuthorizationException(message)).when(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, false, false, false);
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.expect()
.statusCode(Status.FORBIDDEN.getStatusCode())
.body("type", is(AuthorizationException.class.getSimpleName()))
.body("message", is(message))
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteNonExistingDeployment() {
doThrow(new NotFoundException("No process definition found with id 'NON_EXISTING_ID'"))
.when(repositoryServiceMock)
.deleteProcessDefinition("NON_EXISTING_ID", false, false, false);
given()
.pathParam("id", "NON_EXISTING_ID")
.expect()
.statusCode(Status.NOT_FOUND.getStatusCode())
.body(containsString("No process definition found with id 'NON_EXISTING_ID'"))
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeployment() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, false, false, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeploymentCascadeFalse() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.queryParam("cascade", false)
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, false, false, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeploymentCascade() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.queryParam("cascade", true)
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, true, false, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeploymentSkipCustomListenersFalse() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.queryParam("skipCustomListeners", false)
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, false, false, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeploymentSkipCustomListeners() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.queryParam("skipCustomListeners", true)
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, false, true, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeploymentCascadeNonsense() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.queryParam("cascade", "bla")
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, false, false, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeploymentSkipCustomListenersNonsense() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.queryParam("skipCustomListeners", "bla")
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, false, false, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDefinitionSkipIoMappings() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.queryParam("skipIoMappings", true)
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, false, false, true);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteDeploymentSkipCustomListenersAndCascade() {
given()
.pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
.queryParam("cascade", true)
.queryParam("skipCustomListeners", true)
.expect()
.statusCode(Status.OK.getStatusCode())
.when()
.delete(SINGLE_PROCESS_DEFINITION_URL);
verify(repositoryServiceMock).deleteProcessDefinition(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, true, true, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void failToDeleteProcessDefinitionNoAuthenticatedTenant() {
//given deployment with a process definition
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list();
//and user with no tenant authentication
identityService.setAuthentication("user", null, null);
// declare expected exception
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("Cannot delete the process definition");
//deletion should end in exception, since tenant authorization is missing
repositoryService.deleteProcessDefinition(processDefinitions.get(0).getId());
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteProcessDefinitionWithAuthenticatedTenant() {
//given deployment with two process definitions
Deployment deployment = testRule.deployForTenant(TENANT_ONE, "org/camunda/bpm/engine/test/repository/twoProcesses.bpmn20.xml");
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId());
List<ProcessDefinition> processDefinitions = processDefinitionQuery.list();
//and user with tenant authentication
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
//when delete process definition with authenticated user
repositoryService.deleteProcessDefinition(processDefinitions.get(0).getId());
//then process definition should be deleted
identityService.clearAuthentication();
assertThat(processDefinitionQuery.count(), is(1L));
assertThat(processDefinitionQuery.tenantIdIn(TENANT_ONE).count(), is(1L));
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteProcessDefinition() {
// given deployment with two process definitions in one xml model file
deployment = repositoryService.createDeployment()
.addClasspathResource("org/camunda/bpm/engine/test/repository/twoProcesses.bpmn20.xml")
.deploy();
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list();
//when a process definition is been deleted
repositoryService.deleteProcessDefinition(processDefinitions.get(0).getId());
//then only one process definition should remain
assertEquals(1, repositoryService.createProcessDefinitionQuery().count());
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteProcessDefinitionDisabledTenantCheck() {
//given deployment with two process definitions
Deployment deployment = testRule.deployForTenant(TENANT_ONE, "org/camunda/bpm/engine/test/repository/twoProcesses.bpmn20.xml");
//tenant check disabled
processEngineConfiguration.setTenantCheckEnabled(false);
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId());
List<ProcessDefinition> processDefinitions = processDefinitionQuery.list();
//user with no authentication
identityService.setAuthentication("user", null, null);
//when process definition should be deleted without tenant check
repositoryService.deleteProcessDefinition(processDefinitions.get(0).getId());
//then process definition is deleted
identityService.clearAuthentication();
assertThat(processDefinitionQuery.count(), is(1L));
assertThat(processDefinitionQuery.tenantIdIn(TENANT_ONE).count(), is(1L));
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testDeleteProcessDefinition() {
testHelper.deploy("org/camunda/bpm/engine/test/repository/twoProcesses.bpmn20.xml");
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list();
authRule.init(scenario)
.withUser("userId")
.start();
//when a process definition is been deleted
repositoryService.deleteProcessDefinition(processDefinitions.get(0).getId());
//then only one process definition should remain
if (authRule.assertScenario(scenario)) {
assertEquals(1, repositoryService.createProcessDefinitionQuery().count());
}
}
内容来源于网络,如有侵权,请联系作者删除!