必须加入分叉节点吗? UML 状态图
Do forked nodes have to be joined? UML State Diagram
分叉的节点最后一定要加入吗?
并且传出的分叉节点可以有守卫吗?
基本上我想做的是return改变客户并同时继续洗车。
但是,也许有更好的方法?
Do forked nodes have to be be joined in the end?
对我来说不,这不是强制性的,但是当所有流和链接的元素也结束时,该组将结束
can outgoing fork nodes have guards?
你的意思是传出流,规范说分叉段不能有Guards或Trigger
Basically what I'm trying to do is return the change to the customer and continue with the car wash at the same time.
是的,它们可以并行完成,从洗衣机的角度来看,当它return更换和洗涤也完成时,一切都完成了
Do forked nodes have to be be joined in the end?
视情况而定。如果您想继续拆分流程,那么可以。如果你不加入他们,你只会有两个松散的末端独立地继续,直到它们中的每一个以一种或另一种方式终止。
And can outgoing fork nodes have guards?
P. UML 2.5 状态的 360
- fork_segment_guards
A fork segment must not have Guards or Triggers.
inv: (source.oclIsKindOf(Pseudostate) and source.oclAsType(Pseudostate).kind = PseudostateKind::fork) implies (guard = null and trigger->isEmpty())
(我错了,在 bruno 注意到我之后修正了这个问题。)
maybe there's a better way to do it?
当然可以。描述事物的方式有很多种。不过除了那个多余的守卫好像还可以。
简而言之
它不是白纸黑字写的,但是如果你分叉,你会有一些限制,迟早会要求你加入实践。只有一种有效的构造可以让您在实践中避免连接。
更多详情
这是令牌并发流动和结束流动规则的间接结果。
根据 UML 2.5 规范,flow-final 具有以下行为:
A FlowFinalNode is a FinalNode that terminates a flow. All tokens
accepted by a FlowFinalNode are destroyed. This has no effect on other
flows in the Activity.
您可以使用它来吸收其中一个并发流上的令牌,而不会影响其他分支。
类似地,activity-final 遵循以下原则:
An ActivityFinalNode is a FinalNode that stops all flows in an
Activity. A token
reaching an ActivityFinalNode owned by an Activity terminates the
execution of that Activity.
但是没有定义每个流的速度的规则,如果没有连接,每个流也不会执行所有预期的活动。这就是缺少同步的问题。
想象一下,您有两个保持独立的分叉流:然后每个流都必须以某种方式结束。如果您没有加入:
If an Activity owns more than one
ActivityFinalNode, then the first one to accept a token (if any)
terminates the execution of the Activity, including the execution of
any other ActivityFinalNodes.
因此,第一个到达 activity-final 的流将中断其他流上正在进行的 activity,从而使其他流的性能不完整。
确保两个分支都能正确结束而不中断的唯一方法是在每个分支上都有一个流最终。
如果其中一个流程周期存在令牌与并发流程相乘的问题,则将其重新注入电路(对应于并发执行)。
避免连接节点的唯一其他方法是使用隐式连接:
An ExecutableNode shall not execute until all incoming ControlFlows
(if any) are offering tokens. That is, there is an implicit join
on the incoming Control Flows. Specific kinds of ExecutableNodes may
have additional prerequisites that must be satisfied before the node
can execute.
但无论隐式还是显式,它都是一个连接 ;-)
分叉的节点最后一定要加入吗? 并且传出的分叉节点可以有守卫吗?
基本上我想做的是return改变客户并同时继续洗车。
但是,也许有更好的方法?
Do forked nodes have to be be joined in the end?
对我来说不,这不是强制性的,但是当所有流和链接的元素也结束时,该组将结束
can outgoing fork nodes have guards?
你的意思是传出流,规范说分叉段不能有Guards或Trigger
Basically what I'm trying to do is return the change to the customer and continue with the car wash at the same time.
是的,它们可以并行完成,从洗衣机的角度来看,当它return更换和洗涤也完成时,一切都完成了
Do forked nodes have to be be joined in the end?
视情况而定。如果您想继续拆分流程,那么可以。如果你不加入他们,你只会有两个松散的末端独立地继续,直到它们中的每一个以一种或另一种方式终止。
And can outgoing fork nodes have guards?
P. UML 2.5 状态的 360
- fork_segment_guards
A fork segment must not have Guards or Triggers.
inv: (source.oclIsKindOf(Pseudostate) and source.oclAsType(Pseudostate).kind = PseudostateKind::fork) implies (guard = null and trigger->isEmpty())
(我错了,在 bruno 注意到我之后修正了这个问题。)
maybe there's a better way to do it?
当然可以。描述事物的方式有很多种。不过除了那个多余的守卫好像还可以。
简而言之
它不是白纸黑字写的,但是如果你分叉,你会有一些限制,迟早会要求你加入实践。只有一种有效的构造可以让您在实践中避免连接。
更多详情
这是令牌并发流动和结束流动规则的间接结果。
根据 UML 2.5 规范,flow-final 具有以下行为:
A FlowFinalNode is a FinalNode that terminates a flow. All tokens accepted by a FlowFinalNode are destroyed. This has no effect on other flows in the Activity.
您可以使用它来吸收其中一个并发流上的令牌,而不会影响其他分支。
类似地,activity-final 遵循以下原则:
An ActivityFinalNode is a FinalNode that stops all flows in an Activity. A token reaching an ActivityFinalNode owned by an Activity terminates the execution of that Activity.
但是没有定义每个流的速度的规则,如果没有连接,每个流也不会执行所有预期的活动。这就是缺少同步的问题。
想象一下,您有两个保持独立的分叉流:然后每个流都必须以某种方式结束。如果您没有加入:
If an Activity owns more than one ActivityFinalNode, then the first one to accept a token (if any) terminates the execution of the Activity, including the execution of any other ActivityFinalNodes.
因此,第一个到达 activity-final 的流将中断其他流上正在进行的 activity,从而使其他流的性能不完整。
确保两个分支都能正确结束而不中断的唯一方法是在每个分支上都有一个流最终。
如果其中一个流程周期存在令牌与并发流程相乘的问题,则将其重新注入电路(对应于并发执行)。
避免连接节点的唯一其他方法是使用隐式连接:
An ExecutableNode shall not execute until all incoming ControlFlows (if any) are offering tokens. That is, there is an implicit join on the incoming Control Flows. Specific kinds of ExecutableNodes may have additional prerequisites that must be satisfied before the node can execute.
但无论隐式还是显式,它都是一个连接 ;-)