Book a Demo

Author Topic: How to add messages to a communication diagram  (Read 4456 times)

Gibbo

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
How to add messages to a communication diagram
« on: January 10, 2008, 07:34:16 am »
Hi There,

I have just started using the Automation Interface and I have managed to create a Communication Diagram and added elements to the diagram complete with associations between the (class) elements.  I would now like to add communication messages on the connectors in very much the same way as right clicking a link on the communication diagram and selecting Add Message <from> - <to>.  Is there anyway to do this programatically?  Looking at the documentation I can't see anything obvious

Thanks

Gibbo

Gibbo

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: How to add messages to a communication diagram
« Reply #1 on: January 11, 2008, 06:17:22 am »
Does anybody know if this is possible?

Thanks

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to add messages to a communication diagram
« Reply #2 on: January 11, 2008, 06:40:56 am »
What about adding two elements of type MessageEndPoint, then connecting them?
No, you can't have it!

Gibbo

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: How to add messages to a communication diagram
« Reply #3 on: January 14, 2008, 05:26:17 am »
Hi,

Thanks for your reply, however I am unsure of how to do this.  Will this give me the ability to add a message / collaboration properties to the diagram?

How do I create an element of type MessageEndPoint?  I can't see that element listed in the documentation

Thanks

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to add messages to a communication diagram
« Reply #4 on: January 14, 2008, 05:44:17 am »
That's a tricky one, and I really can't say.

However, this is listed in the t_objecttypes table, so technically it should exist...
No, you can't have it!

Gibbo

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: How to add messages to a communication diagram
« Reply #5 on: January 14, 2008, 07:18:32 am »
One thing I have noticed is that when I manually add a message to an association between two classes on a Communication Diagram that EA actually adds a relationship of type Collaboration to the two classes.  In code I can actually see this collaboration relationship but I can seem to make it appear on a new diagram.  I have tried adding it as a diagramLink using the following code, but it does not appear



DiagramLink diagramLink = diagram.GetDiagramLinks().AddNew("link", "otDiagramLink");


diagramLink.SetConnectorID(connector.GetConnectorID());


diagramLink.SetDiagramID(diagram.GetDiagramID());


diagramLink.SetIsHidden(false);




diagramLink.Update();


diagram.Update();


Is there something I am missing?  Funny enough if I delete the diagram where the collaboration was set up then the relationship disappears from the two class elements.  This means that the diagram is controlling the relationship, which seems a bit wierd.

Any help would be much appreciated.  :)

Note that associations show with no problem (automatically), but collaborations don't.  I think this makes sense as you might not want to show all collaborations, but the option to show some would be nice