java - Spring Activiti 网关

标签 java spring activiti

我对 Spring 和 Activiti 都是个菜鸟,所以这应该是一个很大的问题。如果我的问题结构不佳或其他什么问题,我提前道歉。

这是我的 Activity 图的一部分:

enter image description here

首先要做的事情:

在服务任务“创建笔记本电脑请求”中,应用程序将保存到数据库。这工作得很好。

在用户任务“批准请求”中,processInstanceId 也会保存到数据库中。

然后,网关进来了。

所以,首先:

  1. 我使用了正确的网关吗?这样,如果响应为"is",则将采用两条"is"路径?
  2. 为了简单起见,假设yesno 路径都通向结束任务。我应该在哪里放置监听器/类,以及在其中放置什么?有某种示例模板吗?也许现在只需要一个基本的“真”或“假”就可以了。
  3. 最后,我在网上看到,要使两条路径汇聚到一个任务,它必须经过网关 - 尽管并非总是如此。什么时候合适?

谢谢!

最佳答案

来自用户指南:

The functionality of the inclusive gateway is based on the incoming and outgoing sequence flow:

fork: all outgoing sequence flow conditions are evaluated and for the sequence flow conditions that evaluate to true the flows are followed in parallel, creating one concurrent execution for each sequence flow. join: all concurrent executions arriving at the inclusive gateway wait in the gateway until an execution has arrived for each of the incoming sequence flows that have a process token. This is an important difference with the parallel gateway. So in other words, the inclusive gateway will only wait for the incoming sequence flows that will be executed. After the join, the process continues past the joining inclusive gateway.

因此,要回答您的问题,您需要研究该方案的 xml 表示形式。

定义包容性网关需要一行 XML:

<inclusiveGateway id="myInclusiveGateway" />

但实际行为( fork 、加入或两者)是由连接到包容性网关的序列流定义的。

如果您愿意,您可以阅读manual 8.4.3.包容性门户。非常有用。

关于java - Spring Activiti 网关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32808142/

相关文章:

java - 使用 spring boot 和 activiti 时找不到进程文件夹

java将日期插入数据库

java - JNLP 文件在 Windows 10 x64 上不起作用

java - 如何在 Spring 使用@Autowired

spring - Maven原型(prototype)不替换属性

postgresql - Postgres 上的 Activiti 5.18.0 不会使用该模式

java - 识别一段时间内的趋势 (Java)

java - 使用 Processing 连接到 Microsoft Access 数据库

java - Spring,依赖注入(inject)查询

java - 与 Activiti 集成时出现 ConversionNotSupportedException