一:bpmn
二:java
如果沒有收到信號,超過等待時間,流程進(jìn)入總經(jīng)理審批,如果在等待時間內(nèi)收到信號,流程進(jìn)入副總經(jīng)理審批。
示例1:發(fā)送信號事件,流程進(jìn)入副總經(jīng)理審批。文章來源:http://www.zghlxwxcb.cn/news/detail-822982.html
repositoryService.createDeployment().name("基于事件的網(wǎng)關(guān)流程")
.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分鐘,流程進(jìn)入總經(jīng)理審批。文章來源地址http://www.zghlxwxcb.cn/news/detail-822982.html
repositoryService.createDeployment().name("基于事件的網(wǎng)關(guān)流程")
.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());
到了這里,關(guān)于Camunda Event Based Gateway的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!