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());
相关推荐
AOwhisky1 天前
Ceph系列第五期:Ceph 对象存储(RADOS Gateway)精讲
linux·运维·笔记·ceph·gateway·对象存储
西凉的悲伤2 天前
Spring Cloud Gateway介绍
java·spring cloud·gateway
苏渡苇3 天前
Spring Cloud Gateway 网关限流
spring cloud·gateway·springboot·网关限流
一个儒雅随和的男子4 天前
Spring cloud组件gateway网关详细剖析
spring·spring cloud·gateway
超梦dasgg4 天前
Gateway 鉴权场景:网关统一鉴权 + 业务应用决定放行规则
java·gateway
木雷坞4 天前
AI Gateway 接入大模型服务后首 token 慢排查:镜像、模型缓存和 GPU 节点
人工智能·缓存·gateway
明夜之约5 天前
Spring Cloud Gateway 深度解析:从路由原理到生产级网关实战
java·spring·spring cloud·gateway
tyler_download6 天前
深入深出openclaw:gateway 服务进程的启动逻辑
gateway
Upsy-Daisy6 天前
OpenClaw 源码解析(七):Gateway 控制平面与 WebSocket RPC 机制
websocket·平面·gateway
香菜烤面包6 天前
SGLang Model Gateway 核心功能解析
gateway