Camunda Event Based Gateway

一:bpmn

二:java

如果没有收到信号,超过等待时间,流程进入总经理审批,如果在等待时间内收到信号,流程进入副总经理审批。

示例1:发送信号事件,流程进入副总经理审批。

java 复制代码
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分钟,流程进入总经理审批。

java 复制代码
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());
相关推荐
lwb_01184 天前
SpringCloud——Gateway新一代网关
spring·spring cloud·gateway
你是人间五月天4 天前
gateway断言配置详解
gateway
weixin_387545645 天前
深入解析 AI Gateway:新一代智能流量控制中枢
人工智能·gateway
yuluo_YX18 天前
AI Gateway 介绍
人工智能·gateway
网硕互联的小客服21 天前
502 Bad Gateway:服务器作为网关或代理时收到无效响应处理方式
运维·服务器·gateway
sevevty-seven21 天前
什么是Gateway
gateway
秋の花22 天前
【GateWay】和权限验证
java·gateway
欧先生^_^23 天前
org.springframework.cloud.gateway 组件解释
gateway
jarenyVO25 天前
Spring Cloud Gateway 全面学习指南
java·gateway
保持学习ing1 个月前
微服务--Gateway网关
java·网关·微服务·gateway