Why DOESN'T this Star UML Sequence Diagram have the activation "rectangle" in the Control object? Am I doing something wrong? Should I set something in Star UML?
How can I add the activation "rectangle" in the Control object?
The simple answer is: because that's how the designers of Star UML designed it to be.
In Star UML if nothing initiates (triggers) the Execution Occurrence (that's the formal name of that rectangle) then... there is no Execution Occurrence. If you want to have it, you need to trigger it somehow (e.g. by self-referencing Initiation message).
I didn't find any option to change that behaviour. I haven't been using the Star UML for quite some time but since the free version has been abandoned earlier than I've started using it, I believe nothing has changed since.
If you're using the newer, proprietary version, you can send a request to the dev team of Star UML to add it as a functionality.
Well, this is because no tool I know of implemented sequence diagrams correctly. According to UML it should be possible to define ExecutionSpecifications (aka activations) independent of any Messages.
However, many tool vendors seem to assume, that an ExecutionSpecification must be started by a message. I can see, where they come from, since every execution has a cause. The problem is that sequence diagrams are not about causality, but about possibly occurring sequences of events. Sequence diagrams don’t mean, that this is the only possible sequence.
If we accept that the tool wants to start an ExecutionSpecification with a Message, the behavior of Star UML is consistent. Please note that a create message (i.e. messageSort=createMessage) does not call the constructor:
UML: A CreateObjectAction is an Action that creates a direct instance of a
given Classifier and places the new instance on its result OutputPin.
The Action has no other effect. In particular, no Behaviors are
executed
I know, this is about Actions, but why should a create message be different? Also, there is a constraint that stops create messages from having a signature:
signature_refer_to
The signature must either refer an Operation (in which case messageSort is either synchCall or asynchCall or reply) or a Signal (in which case messageSort is asynchSignal).
That means, you cannot reference a constructor in the create message. You will need to call the constructor explicitly. The sender of this message is the same Lifeline that created the new object. It should not be a self message, since this is not what is happening in reality and is therefore a workaround.
There is another option. You can make the class an active class.
An active object is an object that, as a direct consequence of its creation, commences to execute its classifierBehavior
Many tools show an ExecutionSpecification covering the whole lifeline for an active Class. Maybe your Class is meant to be active?
PS: Of course, this is not completely correct, since the classifier behavior also needs to be started explicitly:
A StartObjectBehaviorAction is a CallAction that starts the execution […] of the classifierBehavior of an object
That means, it doesn’t start automatically. We need an ActionExecutionSpecification to start it. Very few tools support this :-(
发布评论
评论(2)
简单的答案是:因为这就是Star UML的设计师设计的。
在Star UML中,如果没有任何启动(触发器)执行的发生(这是该矩形的正式名称),那么……没有执行。如果您想拥有它,则需要以某种方式触发它(例如,通过自我引用启动消息)。
我没有找到任何改变这种行为的选择。我已经有一段时间没有使用Star UML了,但是由于免费版本已经比我开始使用的版本更早地放弃了,所以我相信此后什么都没有改变。
如果您使用的是较新的专有版本,则可以向Star UML的开发团队发送请求,以将其添加为功能。
The simple answer is: because that's how the designers of Star UML designed it to be.
In Star UML if nothing initiates (triggers) the Execution Occurrence (that's the formal name of that rectangle) then... there is no Execution Occurrence. If you want to have it, you need to trigger it somehow (e.g. by self-referencing Initiation message).
I didn't find any option to change that behaviour. I haven't been using the Star UML for quite some time but since the free version has been abandoned earlier than I've started using it, I believe nothing has changed since.
If you're using the newer, proprietary version, you can send a request to the dev team of Star UML to add it as a functionality.
好吧,这是因为否工具我知道正确实现的序列图。根据UML,应该可以定义独立于任何消息的Executions Percifications(又称激活)。
但是,许多工具供应商似乎假设必须通过消息启动执行规范。我可以看到它们来自哪里,因为每个执行都有原因。问题在于序列图与因果关系无关,而与可能发生的事件序列有关。序列图并不意味着这是唯一可能的序列。
如果我们接受该工具想要使用消息启动执行规范,则Star UML的行为是一致的。请注意,创建消息(IE Messageort = createMessage)确实 调用构造函数:
,这是关于操作的,但是为什么创建消息应该与众不同?此外,还有一个约束,可以阻止创建消息具有签名:
这意味着,您不能在创建消息中引用构造函数。您需要明确调用构造函数。此消息的发件人与创建新对象的生命线相同。它不应该是一个自我信息,因为这不是现实中发生的事情,因此是解决方法。
还有另一个选择。您可以使课程成为活动课程。
许多工具显示了执行规范,涵盖了活动类的整个生命线。也许您的班级本来应该活跃?
PS:当然,这不是完全正确的,因为分类器行为也需要明确启动:
,该对象表示不会自动启动。我们需要一个ActionExecutions Pecifitific来启动它。很少有工具支持这一点:-(
Well, this is because no tool I know of implemented sequence diagrams correctly. According to UML it should be possible to define ExecutionSpecifications (aka activations) independent of any Messages.
However, many tool vendors seem to assume, that an ExecutionSpecification must be started by a message. I can see, where they come from, since every execution has a cause. The problem is that sequence diagrams are not about causality, but about possibly occurring sequences of events. Sequence diagrams don’t mean, that this is the only possible sequence.
If we accept that the tool wants to start an ExecutionSpecification with a Message, the behavior of Star UML is consistent. Please note that a create message (i.e. messageSort=createMessage) does not call the constructor:
I know, this is about Actions, but why should a create message be different? Also, there is a constraint that stops create messages from having a signature:
That means, you cannot reference a constructor in the create message. You will need to call the constructor explicitly. The sender of this message is the same Lifeline that created the new object. It should not be a self message, since this is not what is happening in reality and is therefore a workaround.
There is another option. You can make the class an active class.
Many tools show an ExecutionSpecification covering the whole lifeline for an active Class. Maybe your Class is meant to be active?
PS: Of course, this is not completely correct, since the classifier behavior also needs to be started explicitly:
That means, it doesn’t start automatically. We need an ActionExecutionSpecification to start it. Very few tools support this :-(