How to set a class operation call as transition in an UML state machine diagram? (Sparx EA)

一世执手 提交于 2020-02-05 13:47:05

问题


Is it possible to reuse an operation call of a class as transition in an UML diagram of Sparx Enterprise Architect (I've got version 9)? If yes, how do I do that?

It's possible to use it as action in an activity diagram and as message in an object diagram, but I can't figure it out for the state machine. I wish there was more integration for software developers...

Furthermore, I wish I could set a state in the diagram as special state of a class instance (class instance == object).


回答1:


Is it possible to reuse an operation call of a class as transition in an UML diagram ...?

Yes. In the state machine diagram: Open the transition properties, enable "Effect is Behavior" and select the operation from the browser.

It's possible to use it as action in an activity diagram ...

Yes. Add a 'Call Operation' action to the activity diagram. Goto, "action properties" -> "Call" and select the operation from the "Behavior:" menu.

... and as message in an object diagram ...

Yes. Draw a link between the objects on the object diagram, right-click the link and select "Add message from ... " (where "..." is the desired direction). Double-click the message and select the operation from the "Message:" drop-down list.



来源:https://stackoverflow.com/questions/33563076/how-to-set-a-class-operation-call-as-transition-in-an-uml-state-machine-diagram

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!