我如何建模从同一个 class 调用操作的 UML Activity?

How do I model UML Activity that calls operations from the same class?

假设我有一些 ClassBehavioredClassifier 的特化)具有三个操作 A()B()C() 以及操作 C 只是调用操作 A 然后 B。 UML 的 CallOperation 操作(参见 16.3.3.1 调用操作 )需要 target 对象,在这种情况下将是一个 上下文对象 UML Specification13.2.3.4 行为分类器 部分中描述的 UML 说法:

a Behavior that is the ownedBehavior of a BehavioredClassifier has that BehavioredClassifier as its context... If a Behavior has a context , then an execution of the Behavior always has an associated context object that is an instance of the context BehavioredClassifier (as long as that BehavioredClassifier is instantiable)

UML Activity 图由于 Read self activity 看起来会很丑(参见 UML 规范中的 16.4.3.4 Read Self Actions) :

我有一种感觉,我在某处读到 Read self 在某些情况下可以省略,并且 target 可能被假定为 上下文对象 案例.

UML文档中有这样的条款吗?

我在 UML Specification 中找不到这样的子句,但找到了解决方案,如下所述。

首先所谓的ActionInputPin是用于target。根据段落16.2.3.3 Pins:

An ActionInputPin provides values by executing another Action. When an Action is enabled by other means, the fromActions on any ActionInputPins owned by the Action are also enabled. The fromActions must execute before the Action owning the ActionInputPins, and the outputs of the fromActions are placed in the corresponding ActionInputPins. The process recurs on any ActionInputPins of the fromActions. In the case that ActionInputPins are used for all inputs, this forms a tree structure that is an Action model of nested expressions, bottoming out at Actions that have no inputs (such as ReadVariableActions or ReadSelfActions)

然后附录 B:UML 图交换 的 UML 规范

... enables interchange of the purely graphical aspects of UML models that modelers have control over, such as the position of shapes on a diagram and line routing points (UML DI). This information must be interchanged between tools to reproduce UML diagrams reliably.

在段落 B.4.3 Activity 图表标签中指出

ActionInputPins with fromActions that are ReadSelfObjectActions may be shown in a shorthand notation that shows only the ActionInputPin and nearby the string “self” interchanged as a UMLLabel with the ReadSelfObjectAction as modelElement.

上面的子句在table Table B.1 UML Shapes中说明如下:

因此,所讨论的模型被转换为如下所示的整洁版本: