Book a Demo

Author Topic: destroy message in communication diagram  (Read 4530 times)

eshuab

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
destroy message in communication diagram
« on: March 22, 2009, 06:05:44 am »
Hello,

i want to visualize a destroy message in a communication diagram. Using the Lifecycle DropDown in the Message Properties menu results in an error message. Is there another way to do it?
Thank you.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: destroy message in communication diagram
« Reply #1 on: March 22, 2009, 08:36:33 am »
If you just want to see the X at the bottom of a lifetime, open the Tools | Options | Diagram | Sequence dialog - see below - and check the GarbageCollect (auto delete) box (below Activation Indicator). Otherwise...

Perhaps you need to enable the option to do this. It seems to be set on a project-by-project basis. [Or at least it requires a project to be open.]

Open your project and from the main menu choose Tool | Options and open the Object Lifetimes panel. If you don't have the Generate Destructor checked, check it and close the dialog. See if you can now generate a destroy message. [You might have to create a new object and lifetime for this. It is also possible you'll have to set the Destructor visibility, depending on your diagram settings; this is less likely though, since the default visibility is Public.]

David
No, you can't have it!

eshuab

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: destroy message in communication diagram
« Reply #2 on: March 22, 2009, 07:46:17 pm »
Hi,

please note, i am talking about a communication diagram, not a sequence diagram. I managed to create destroy messages in sequence diagrams, but not in communication diagrams. Actually i simply want to have a message that has not a method call beside the arrow but simply something like <<destroy>>.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: destroy message in communication diagram
« Reply #3 on: March 23, 2009, 02:03:14 am »
Oops, you were clear about that and I still managed to miss it. Sorry.

What happens if you simply create a message connector, do not give it a name, and assign the «destroy» stereotype? If the stereotype does not appear in the drop-down list for the message, just type it in by hand. Remember to use lower case and exclude the punctuation.
No, you can't have it!

eshuab

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: destroy message in communication diagram
« Reply #4 on: March 23, 2009, 06:02:18 am »
hi,

yep, already tried it, but please try it for yourself, it looks crappy, because EA wants to put the stereotype beneath the message name and if there is no message name, the stereotype is still too low.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: destroy message in communication diagram
« Reply #5 on: March 24, 2009, 12:42:14 am »
I see your point. There's not a whole lot you can do about that (I think).

EA has 6 messages it can display on a connector - above and below the line, at each end and in the middle.

It seems that the EA rendering engine assigns certain attributes to specific message locations. If you choose to display these attributes they will be shown where EA puts them; you don't get a choice. Likewise, if you show or hide the message locations - there's a dialog for this - then you are effectively telling EA whether or not to display the corresponding attributes of the connector.

Some of these locations are reserved for the labels you most often assign to a connector. The name of the connection, and the roles you assign at each end. The other locations seem to be used for multiplicity and the stereotype. Unfortunately the reserved location for the stereotype is below the line.

You might be able to change the appearance with an add-in. You would have to check the actual schema of a project. See if the text assigned to the middle top label was shown anywhere. If so, have the add-in copy the stereotype to there. If that worked you might get the display you desire. I think you would want to turn off connector stereotypes, otherwise you might see the same label above and below the line.

If that approach works, take a look at the connector dialog (by hand, not in the add-in). If you see the stereotype in the connector name field you might be able to change it by hand. I'm not too sure this is the way to go, but check it out in case there are side effects.

David
No, you can't have it!