BPMN 2.0 XML flowNodes 什么时候应该包含传入和传出元素?

When should BPMN 2.0 XML flowNodes contain incoming and outgoing elements?

根据 BPMN 2.0.2 的第 8.4.13 节,流节点(网关、活动和事件的父级)包含以下属性:

incoming: Sequence Flow [0..*] This attribute identifies the incoming Sequence Flow of the FlowNode.
outgoing: Sequence Flow [0..*] This attribute identifies the outgoing Sequence Flow of the FlowNode.

尽管如此,我看到的许多 BPMN 文件都决定不包含这些元素。例如,我在 http://www.omg.org/spec/BPMN/20100601/10-06-02.pdf. Nor in the XML snippets from https://docs.camunda.org/manual/7.3/api-references/bpmn20/#tasks. However, I do see them in the samples at http://www.omg.org/spec/BPMN/20100602/2010-06-03/.

的官方 BPMN 2.0 by Example 文档中看不到它们

这个变化有什么解释吗?当序列流连接到节点时是否需要这些元素?常用工具有吗?

一个有趣的问题,至少在理论上是这样。 大多数 BPMN 建模者将使用 sourceRef 和 targetRef 属性来表示 FlowNode 元素的源和目标。 http://www.omg.org/spec/BPMN/20100602/2010-06-03/ 样本的原因。使用 incoming/outgoing 语义很可能是因为它们都是由同一个工具 (Trisotech) 生成的。 老实说,我不能说一个是对还是错,但我可以说很少有建模者使用 incoming/outgoing 语义。

来自 IBM 的一位同事:

They're not generally required. The incoming/outgoing lists can be derived in most cases, meaning they can be calculated from the sourceRef/targetRef of the sequence flow elements. In those cases, the incoming/outgoing lists are simply a convenience.

However, they are required when you have conditional sequence flow. For example, consider conditions on the sequence flow leaving an activity or exclusive gateway. There, the order of the outgoing flows are important, and that information is only carried in the outgoing list.