Uml 2.5活动图中令牌的用途 [英] purpose of tokens in Activity diagrams of Uml 2.5

查看:343
本文介绍了Uml 2.5活动图中令牌的用途的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UML规范2.5 说:


一个ActivityNode对另一个的影响由在活动节点之间的活动边缘上的
令牌 的流指定。

The effect of one ActivityNode on another is specified by the flow of tokens over the ActivityEdges between the ActivityNodes.

但是上面的定义是模糊的;

But above definition is obscure; specially because tokens are not explicitly modeled in an Activity.

在阅读 15.2.3.3活动边缘令牌未在活动中明确建模。

After reading 15.2.3.3 Activity Edges section of specifications, I think purpose of them is:


有能力描述该图可能等待的
其他令牌
或拒绝流
而不是立即进入下一个节点

to capable the diagram to describe it may wait for other token or refuse flow instead of entering next node immediately

这是真的吗?也是令牌的唯一目的吗?如果是真的,为什么我们不使用带有条件的决策节点最终流节点来显示拒绝该条件下的流量,而不是令牌 guard s?还是将信息分组到更大的对象节点中,该节点携带所有必需的数据而不是使用 weight

Is it true? Also is it the only purpose of tokens? If it is true, why we do not use a decision node with a condition and a end flow node for showing refusing flow under that condition instead of token and guards? Or grouping information into larger objects node which carries all necessary data instead of using weight?

推荐答案

活动图和状态机均源自 Petri网。给出完整的描述将使这个答案无效,因此我尝试将其精简。

Activity diagrams and state machines are both derived from Petri nets. Giving a full description would blow this answer, so I try to boil it down.

令牌可以说是一些信息。它是原子的,无法拆分。而是从上下文中定义的事件的大爆炸创建的(通常以大黑点显示)。它沿着 InformationFlow 连接器(最终被守卫在需要等待的地方阻塞)行进到节点。节点具有1到许多 InformationFlow 连接器。当节点的所有传入 InformationFlow 连接器都到达令牌时,该节点将变为活动状态。当节点最终确定时,它会沿其所有传出的 InformationFlow 连接器发送单个令牌(至少UML操作会这样做,这称为隐式分叉)。有一些特殊的节点(例如fork和merge),它们的行为有所不同(请参见规格)。最终,令牌可能会掉入一个水槽(通常是一个带有脂肪点的圆圈),在那里它们随即消失。

A token is, so to say, a bit of information. It's atomic and can not be split. Rather it is created from a "big bang" out of an event which is defined in the context (shown usually by a large black dot). It travels along InformationFlow connectors (eventually blocked by guards where it has to wait) to nodes. Nodes have 1 to many InformationFlow connectors. A node becomes active when at all of its incoming InformationFlow connectors a token has arrived. When the node finalizes it sends single tokens along all its outgoing InformationFlow connectors (at least UML actions do so which is called implicit fork). There are special nodes like fork and merge which behave a bit different (see the specs). Finally tokens can fall in a sink (usually a circle with a fat dot inside) where they just vanish as they appeared.

因此,从单个令牌中就可以了(不再说明) (从此处开始的多个起始点的详细信息/问题)从起始节点出现,此令牌在网络中传播,最终创建了其他令牌,这些令牌都在流通,直到(通常)所有令牌都汇入接收器。

So from a single token (not going to explain the details/issues of multiple start points here) emerging from a start node this token travels in the net, eventually creating other tokens all circulating until (usually) all tokens have gone to sinks. During that the net is said to be active.

tl; dr 不,您的假设不正确。

tl;dr No, your assumption is not correct that way.

这篇关于Uml 2.5活动图中令牌的用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆