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());
相关推荐
serendipity_hky1 天前
【SpringCloud | 第4篇】Gateway网关统一入口
spring·spring cloud·微服务·gateway
库库林_沙琪马2 天前
4、Gateway
gateway
全靠bug跑2 天前
Spring Cloud Gateway 实战:统一鉴权与用户信息全链路透传
java·开发语言·gateway·拦截器
骚戴3 天前
架构设计之道:构建高可用的大语言模型(LLM) Enterprise GenAI Gateway
java·人工智能·架构·大模型·gateway·api
Maiko Star5 天前
Gateway网关拦截自定义header & 用户上下文打通实战
gateway·threadlocal
skywalk81638 天前
LLM API Gateway:使用Comate Spec Mode创建大模型调用中转服务器
服务器·人工智能·gateway·comate
我是小妖怪,潇洒又自在8 天前
springcloud alibaba(七)Gateway--服务网关
spring·spring cloud·gateway
boy快快长大11 天前
【Spring Cloud Alibaba】Gateway(一)
数据库·gateway
谷隐凡二12 天前
网关的核心概念及简单演进介绍
gateway