repositoryService.createDeployment().name("内嵌子流程").addClasspathResource("bpmn/embed_sub_process.bpmn").deploy();
identityService.setAuthenticatedUserId("huihui");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("EmbedSubProcess");
Task task = taskService.createTaskQuery() .processInstanceId(processInstance.getId()).singleResult();
taskService.complete(task.getId());
ACT_HI_TASKINST:上传vlog节点已经审批完成
ACT_RU_TASK:进入子流程,路由网关为并行网关,所以同时出现3个任务。
ACT_RU_EXECUTION
List<Task> list = taskService.createTaskQuery().processInstanceId("097a8235-b080-11ee-982f-92e97825df95").list();
for (Task task : list) {
taskService.complete(task.getId());
}
ACT_RU_TASK:流程来到上传成功节点。
ACT_RU_EXECUTION:数据变成了一条,活动来到上传成功。
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>3.0.9</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<version>0.7.1</version>
</dependency>
repositoryService.createDeployment().name("调用流程").addClasspathResource("bpmn/main_process.bpmn").deploy();
identityService.setAuthenticatedUserId("huihui");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("MainProcess");
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
VariableMap variables = Variables.createVariables().putValue("sourcePath", "xxx.rmvb");
taskService.complete(task.getId(), variables);
ACT_RU_TASK:进入调用的流程。
ACT_RU_EXECUTION:
List<Task> list = taskService.createTaskQuery().processInstanceId("719d2260-b08b-11ee-8cfc-92e97825df95").list();
for (Task task : list) {
taskService.complete(task.getId());
}
ACT_RU_VARIABLE:Out Mappings中的sourceResult变量赋值成功了。