当前位置: 首页>>代码示例>>Java>>正文


Java RepositoryService.deleteDeployment方法代码示例

本文整理汇总了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());
        }
    }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:34,代码来源:ActivitiSmokeTest.java

示例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";
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:67,代码来源:ConsoleController.java

示例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();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:61,代码来源:ProcessDefinitionCacheTest.java

示例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
	
}
 
开发者ID:billchen198318,项目名称:bamboobsc,代码行数:11,代码来源:TestBPMN001.java


注:本文中的org.activiti.engine.RepositoryService.deleteDeployment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。