本文整理汇总了Java中org.activiti.engine.RepositoryService.deleteDeployment方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryService.deleteDeployment方法的具体用法?Java RepositoryService.deleteDeployment怎么用?Java RepositoryService.deleteDeployment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.RepositoryService
的用法示例。
在下文中一共展示了RepositoryService.deleteDeployment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDeploy
import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
public void testDeploy() throws Exception
{
ProcessEngine engine = buildProcessEngine();
RepositoryService repoService = engine.getRepositoryService();
Deployment deployment = deployDefinition(repoService);
assertNotNull(deployment);
RuntimeService runtimeService = engine.getRuntimeService();
try
{
ProcessInstance instance = runtimeService.startProcessInstanceByKey("testTask");
assertNotNull(instance);
String instanceId = instance.getId();
ProcessInstance instanceInDb = findProcessInstance(runtimeService, instanceId);
assertNotNull(instanceInDb);
runtimeService.deleteProcessInstance(instanceId, "");
}
finally
{
// List<Deployment> deployments = repoService.createDeploymentQuery().list();
// for (Deployment deployment2 : deployments)
// {
// repoService.deleteDeployment(deployment2.getId());
// }
repoService.deleteDeployment(deployment.getId());
}
}
示例2: removeDeployment
import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
/**
* 删除部署.
*/
@RequestMapping("console-removeDeployment")
public String removeDeployment(
@RequestParam("deploymentId") String deploymentId) {
RepositoryService repositoryService = processEngine
.getRepositoryService();
List<ProcessDefinition> processDefinitions = repositoryService
.createProcessDefinitionQuery().deploymentId(deploymentId)
.list();
for (ProcessDefinition processDefinition : processDefinitions) {
String hql = "from BpmConfBase where processDefinitionId=? or (processDefinitionKey=? and processDefinitionVersion=?)";
List<BpmConfBase> bpmConfBases = bpmConfBaseManager.find(hql,
processDefinition.getId(), processDefinition.getKey(),
processDefinition.getVersion());
for (BpmConfBase bpmConfBase : bpmConfBases) {
for (BpmConfNode bpmConfNode : bpmConfBase.getBpmConfNodes()) {
for (BpmConfCountersign bpmConfCountersign : bpmConfNode
.getBpmConfCountersigns()) {
bpmConfBaseManager.remove(bpmConfCountersign);
}
for (BpmConfForm bpmConfForm : bpmConfNode
.getBpmConfForms()) {
bpmConfBaseManager.remove(bpmConfForm);
}
for (BpmConfListener bpmConfListener : bpmConfNode
.getBpmConfListeners()) {
bpmConfBaseManager.remove(bpmConfListener);
}
for (BpmConfNotice bpmConfNotice : bpmConfNode
.getBpmConfNotices()) {
bpmConfBaseManager.remove(bpmConfNotice);
}
for (BpmConfOperation bpmConfOperation : bpmConfNode
.getBpmConfOperations()) {
bpmConfBaseManager.remove(bpmConfOperation);
}
for (BpmConfRule bpmConfRule : bpmConfNode
.getBpmConfRules()) {
bpmConfBaseManager.remove(bpmConfRule);
}
for (BpmConfUser bpmConfUser : bpmConfNode
.getBpmConfUsers()) {
bpmConfBaseManager.remove(bpmConfUser);
}
bpmConfBaseManager.remove(bpmConfNode);
}
bpmConfBaseManager.remove(bpmConfBase);
}
}
repositoryService.deleteDeployment(deploymentId, true);
return "redirect:/bpm/console-listDeployments.do";
}
示例3: testDeployRevisedProcessAfterDeleteOnOtherProcessEngine
import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
public void testDeployRevisedProcessAfterDeleteOnOtherProcessEngine() {
// Setup both process engines
ProcessEngine processEngine1 = new StandaloneProcessEngineConfiguration()
.setProcessEngineName("reboot-test-schema")
.setDatabaseSchemaUpdate(org.activiti.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE)
.setJdbcUrl("jdbc:h2:mem:activiti-process-cache-test;DB_CLOSE_DELAY=1000")
.setJobExecutorActivate(false)
.buildProcessEngine();
RepositoryService repositoryService1 = processEngine1.getRepositoryService();
ProcessEngine processEngine2 = new StandaloneProcessEngineConfiguration()
.setProcessEngineName("reboot-test")
.setDatabaseSchemaUpdate(org.activiti.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
.setJdbcUrl("jdbc:h2:mem:activiti-process-cache-test;DB_CLOSE_DELAY=1000")
.setJobExecutorActivate(false)
.buildProcessEngine();
RepositoryService repositoryService2 = processEngine2.getRepositoryService();
RuntimeService runtimeService2 = processEngine2.getRuntimeService();
TaskService taskService2 = processEngine2.getTaskService();
// Deploy first version of process: start->originalTask->end on first process engine
String deploymentId = repositoryService1.createDeployment()
.addClasspathResource("org/activiti/engine/test/cache/originalProcess.bpmn20.xml")
.deploy()
.getId();
// Start process instance on second engine
String processDefinitionId = repositoryService2.createProcessDefinitionQuery().singleResult().getId();
runtimeService2.startProcessInstanceById(processDefinitionId);
Task task = taskService2.createTaskQuery().singleResult();
assertEquals("original task", task.getName());
// Delete the deployment on second process engine
repositoryService2.deleteDeployment(deploymentId, true);
assertEquals(0, repositoryService2.createDeploymentQuery().count());
assertEquals(0, runtimeService2.createProcessInstanceQuery().count());
// deploy a revised version of the process: start->revisedTask->end on first process engine
//
// Before the bugfix, this would set the cache on the first process engine,
// but the second process engine still has the original process definition in his cache.
// Since there is a deployment delete in between, the new generated process definition id is the same
// as in the original deployment, making the second process engine using the old cached process definition.
deploymentId = repositoryService1.createDeployment()
.addClasspathResource("org/activiti/engine/test/cache/revisedProcess.bpmn20.xml")
.deploy()
.getId();
// Start process instance on second process engine -> must use revised process definition
processDefinitionId = repositoryService2.createProcessDefinitionQuery().singleResult().getId();
runtimeService2.startProcessInstanceByKey("oneTaskProcess");
task = taskService2.createTaskQuery().singleResult();
assertEquals("revised task", task.getName());
// cleanup
repositoryService1.deleteDeployment(deploymentId, true);
processEngine1.close();
processEngine2.close();
}
示例4: deleteProcess
import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
@Test
public void deleteProcess() throws Exception {
String deploymentId = "10001";
RepositoryService repositoryService = (RepositoryService) AppContext.getBean("repositoryService");
repositoryService.deleteDeployment(deploymentId);
//repositoryService.deleteDeployment(processId, true); no need it
}