企业架构师:在状态转换中引用实例化类的属性 [英] Enterprise Architect: Refering to An Instantiated Class's Attribute in a State Transition

查看:73
本文介绍了企业架构师:在状态转换中引用实例化类的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Enterprise Architect中,我有一个用枚举属性定义的类。是否可以根据对该枚举值的测试在状态机中创建转换?

In Enterprise Architect, I have a class defined with an attribute which is an enum. Is it possible to create a transition in a state machine based on a test of that enum's value? How?

我发现创建触发器或信号非常有限的过渡的唯一方法。

I find the only way to create transitions with triggers or signals very limited.

我的意图是将状态机导出到需求文档。虽然,我认为这应该适合模拟。

My intent is to export the state machine to a requirements document. Although, I would think this should work with simulation.

推荐答案

触发器是导致令牌沿着状态转换流动的原因。以这种状态转换为例:

A trigger is what causes a token to flow along a state transition. Take for example this state transition:

何时您打开看到的过渡属性

When you open the properties of the transition you see

现在,您可以通过单击名称:的省略号来添加触发器。在这里,您既可以选择现有触发器,也可以即时创建新触发器。

Now you can add a trigger by clicking the ellipsis right to Name:. Here you either select an existing trigger or you create a new one on the fly.

可以从下拉菜单中选择触发类型:

The trigger type can be selected from the drop down:

信号是默认设置,您可以从省略号右至规范中选择一个:。您可以像这样对信号建模:

Signal is the default and you can choose one from the ellipsis right to the Specification:. You can model the signal like this:

并且您会在注释中描述(例如)枚举更改时将触发。

and you would describe in it's note that (e.g.) it fires whenever the enumeration changes.

该图未显示信号的使用,但隐藏在连接器的属性。为了形象化,您可以添加适当的注释并将其链接到连接器和元素:

The diagram does not show the use of the signal, but it's hidden in the connector's properties. To visualize that you could add appropriate notes and link them up to connector and elements:

注:状态机是为类建模的(通常将它们放在类中)。如果实例化该类,则实例还将具有该状态机,该状态机可以作为实例中的某种代码运行。

Note: state machines are modeled for classes (and you usually put them inside the class). If you instantiate that class the instance will also have that state machine which can run as some kind of code inside the instance.

这篇关于企业架构师:在状态转换中引用实例化类的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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