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());
相关推荐
攸攸太上3 小时前
Spring Gateway学习
java·后端·学习·spring·微服务·gateway
Bulut09072 天前
SpringCloud 2023 Gateway的Predicate配置详解、自定义Route Predicate Factory
spring cloud·gateway·predicate配置详解·自定义路由断言factory·内置路由predicate
wangqiaowq4 天前
Egress Gateway 是一个重要的组件,用于管理从服务网格内部到外部服务的流量
网络·gateway
wangqiaowq5 天前
Ingress Gateway 它负责处理进入集群的 HTTP 和 TCP 流量
tcp/ip·http·gateway
鲨鱼辣椒ぅ5 天前
springboot集成nacos+gateway+feign
spring boot·后端·gateway
fanhaifeng665 天前
SpringCloud Gateway 打印请求响应日志、跨域全局配置
spring·spring cloud·gateway
大灰狼19137 天前
【基于spring-cloud-gateway实现自己的网关过滤器】
spring cloud·gateway
wangqiaowq8 天前
Gateway和VirtualService
gateway
世俗ˊ9 天前
微服务-- Gateway服务网关
java·微服务·gateway
她又在丛中笑10 天前
SpringBoot gateway如何支持跨域?
java·spring boot·gateway