一:bpmn
二:java
如果没有收到信号,超过等待时间,流程进入总经理审批,如果在等待时间内收到信号,流程进入副总经理审批。
示例1:发送信号事件,流程进入副总经理审批。文章来源:https://www.toymoban.com/news/detail-822982.html
repositoryService.createDeployment().name("基于事件的网关流程")
.addClasspathResource("bpmn/envent-base-gateway.bpmn").deploy();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("EventBasedGatwayProcess");
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
taskService.setAssignee(task.getId(), "huihui");
taskService.complete(task.getId());
Thread.sleep(1000 * 60 * 1);
runtimeService.createSignalEvent("signal_vgm").send();
task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
System.out.println(task.getTaskDefinitionKey());
示例1:等待3分钟,流程进入总经理审批。文章来源地址https://www.toymoban.com/news/detail-822982.html
repositoryService.createDeployment().name("基于事件的网关流程")
.addClasspathResource("bpmn/envent-base-gateway.bpmn").deploy();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("EventBasedGatwayProcess");
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
taskService.setAssignee(task.getId(), "huihui");
taskService.complete(task.getId());
Thread.sleep(1000 * 60 * 3);
task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
System.out.println(task.getTaskDefinitionKey());
到了这里,关于Camunda Event Based Gateway的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!