Activity Diagams 中的两个流可以执行相同的操作吗? [英] Can Two Flows Go to Same Action in Activity Diagams?

查看:32
本文介绍了Activity Diagams 中的两个流可以执行相同的操作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个流程要执行相同的操作.操作是Make Payment.一种流程用于,另一种用于购买.在这两种情况下,客户都必须付款.我想对两个流使用一个 payment 操作.或者我应该使用合并节点,然后将输出连接到 make payment 操作.我不确定是否可以使用合并节点,因为两个流程相互独立.我上传了一张图片.

I have two flows going to the same action. The action is Make Payment. One flow is for rent, and other is for purchase. In both cases customer has to pay. I want to use one payment action for both flows. Or should I use merge node and then connect the output to make payment action. I am not sure whether I can use merge node or not, because both flows are independent of each other. I have uploaded a picture.

推荐答案

这个问题让我措手不及.当有多个不受保护的转换离开状态/动作时,会发出一个隐式分叉,因此多个令牌独立离开和移动.第 401 页:

This one caught me on the wrong foot. When there are multiple unguarded transitions going out of a state/action an implicit fork is issued so multiple tokens leave and travel independently. P. 401:

当 ExecutableNode 完成执行时,代表该执行的控制令牌将从 ExecutableNode 中移除,并且在 ExecutableNode 的所有传出控制流上提供控制令牌.也就是说,从 ExecutableNode 到其传出的 ControlFlows 的控制流存在一个隐式分支.

When an ExecutableNode completes an execution, the control token representing that execution is removed from the ExecutableNode and control tokens are offered on all outgoing ControlFlows of the ExecutableNode. That is, there is an implicit fork of the flow of control from the ExecutableNode to its outgoing ControlFlows.

我似乎记得类似地,两个传入的转换意味着都必须传递一个令牌.并继续阅读(上)第 1 页.401:

I seemed to remember that analogously two incoming transitions mean that both have to deliver a token. And reading on (above) on p. 401:

在所有传入的控制流(如果有)都提供令牌之前,ExecutableNode 不应执行.也就是说,传入的控制流有一个隐式连接.特定种类的 ExecutableNode 可能有额外的先决条件,必须在节点执行之前满足这些先决条件.

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.

现在当你看 p.425你找到了

Now when you look at p. 425 you find

合并节点是一个控制节点,它汇集了多个备用流.它不用于同步并发流,而是接受多个交替流中的一个.

A merge node is a control node that brings together multiple alternate flows. It is not used to synchronize concurrent flows but to accept one among several alternate flows.

所以你来了.您需要事先合并以使其正确.

So here you are. You need to merge beforehand to make it correct.

N.B.:如果您进行非正式建模(因此在记录了这一点的特定领域中),您可以接受您的符号,因为它经常被使用.理论和实践...不过不推荐这样做.

N.B.: If you are modeling informally (so in a certain domain where this is documented) you could live with your notation since it's often used. Theory and practice... It's not recommended, though.

这篇关于Activity Diagams 中的两个流可以执行相同的操作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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