camunda流程实例启动的⼀些简单操作
public class ZccRuntimeService {
RuntimeService runtimeService;
RepositoryService repositoryService;
@Before
public void init(){
ProcessEngineConfiguration processEngineConfiguration = ateProcessEngineConfigurationFromResource("l");
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
runtimeService = RuntimeService();
RepositoryService();
System.out.println(runtimeService);
}
createprocessa/**
* 部署流程
*/
@Test
public void deploymentBPMN(){
DeploymentBuilder ateDeployment();
Deployment deploy = deploymentBuilder.name("审批").tenantId("a").source("本地测试").addClasspathResource("my3.bpmn").deploy();
}
/**
* 启动流程实例
* insert into ACT_HI_TASKINST ( ID_, PROC_DEF_KEY_, PROC_DEF_ID_, ROOT_PROC_INST_ID_, PROC_INST_ID_, EXECUTION_ID_, CASE_DEF_KEY_, CASE_DEF_ID_, CASE_INST_ID_, CASE_EXECUTION_ID_, ACT_ * Result 1: insert into ACT_HI_PROCINST ( ID_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_KEY_, PROC_DEF_ID_, START_TIME_, END_TIME_, REMOVAL_TIME_, DURATION_, START_USER_ID_, START_ACT_ID_, END_A * Result 2: insert into ACT_HI_IDENTITYLINK ( ID_, TIMESTAMP_, TYPE_, USER_ID_, GROUP_ID_, TASK_ID_, ROOT_PROC_INST_ID_, PROC_DEF_ID_, OPERATION_TYPE_, ASSIGNER_ID_, PROC_DEF_KEY_, TENANT_ID_, RE * Result 3: insert into ACT_HI_ACTINST ( ID_, PARENT_ACT_INST_ID_, PROC_DEF_KEY_, PROC_DEF_ID_, ROOT_PROC_INST_ID_, PROC_INST_ID_, EXECUTION_ID_, ACT_ID_, TASK_ID_, CALL_PROC_INST_ID_, CALL_CASE_ * Result 4: insert into ACT_RU_EXECUTION ( ID_, ROOT_PROC_INST_ID_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_ID_, ACT_ID_, ACT_INST_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_, IS_EVENT_SCOPE_, PAR * Result 5: insert into ACT_RU_TASK ( ID_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, PRIORITY_, CREATE_TIME_, OWNER_, ASSIGNEE_, DELEGATION_, EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, CASE_EXECU */
@Test
public void startProcessInstanceBykey(){
//ProcessInstance startProcessInstanceByKey(String processDefinitionKey);
String processDefinitionKey="Process_0plj3di";
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey);
System.out.Id()+BusinessKey()+ProcessInstanceId()+TenantId());
}
/**
* 从任意节点启动流程实例
*/
@Test
public void startProcessInstanceBykey2(){
//ProcessInstance startProcessInstanceByKey(String processDefinitionKey);
String processDefinitionKey="Process_0plj3di";
ProcessInstantiationBuilder processInstantiationBuilder = ateProcessInstanceByKey(processDefinitionKey);
//startBeforeActivity(String activityId);
//String activityId="Task_0c5po9a";部门经理
String activityId="Task_15ymjc7";//总经理
ProcessInstance processInstance = processInstantiationBuilder.businessKey("001").startBeforeActivity(activityId).execute();
System.out.println(processInstance);
}
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论