camunda流程实例启动的一些简单操作

2019-10-14 14:44| 发布者: |

public class ZccRuntimeService {
RuntimeService runtimeService;
RepositoryService repositoryService;

@Before
public void init{
ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource;
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine;
runtimeService = processEngine.getRuntimeService;
repositoryService=processEngine.getRepositoryService;
System.out.println;
}

/**
* 部署流程
*/
@Test
public void deploymentBPMN{
DeploymentBuilder deploymentBuilder=repositoryService.createDeployment;
Deployment deploy = deploymentBuilder.name.tenantId.source.addClasspathResource.deploy;

}

/**
* 启动流程实例
* insert into ACT_HI_TASKINST values Update counts: [1]
* Result 1: insert into ACT_HI_PROCINST values Update counts: [1]
* Result 2: insert into ACT_HI_IDENTITYLINK values Update counts: [1]
* Result 3: insert into ACT_HI_ACTINST values Update counts: [1, 1]
* Result 4: insert into ACT_RU_EXECUTION values Update counts: [1]
* Result 5: insert into ACT_RU_TASK values Update counts: [1]
*/
@Test
public void startProcessInstanceBykey{
//ProcessInstance startProcessInstanceByKey;
String processDefinitionKey="Process_0plj3di";
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey;
System.out.println+processInstance.getBusinessKey+processInstance.getProcessInstanceId+processInstance.getTenantId);
}

/**
* 从任意节点启动流程实例
*/
@Test
public void startProcessInstanceBykey2{
//ProcessInstance startProcessInstanceByKey;
String processDefinitionKey="Process_0plj3di";
ProcessInstantiationBuilder processInstantiationBuilder = runtimeService.createProcessInstanceByKey;
//startBeforeActivity;
//String activityId="Task_0c5po9a";部门经理
String activityId="Task_15ymjc7";//总经理
ProcessInstance processInstance = processInstantiationBuilder.businessKey.startBeforeActivity.execute;
System.out.println;
}
}
猜你喜欢
<
>
关于我们
AB模版网成立于2014年,我们是一家专注用户体验设计开发与互联网品牌建设的设计公司,创立至今为2000多位客户提供了创新与专业的设计方案。设计服务范围包括:交互原型设计、产品视觉设计、网站设计与开发建设、移动及软件产品界面设计、图标设计、品牌及平面设计等。

联系我们

13588889999服务时间:9:00-18:00)

admin@adminbuy.cn

官方微信官方微信

部门热线

前   台:13588889999
业务部:13588889999
客服部:13588889999
技术部:13566667777
人事部:13566667777

咨询电话13588889999 返回顶部
返回顶部