Author Topic: Sequence Diagram Properties  (Read 9169 times)

renoyl

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Sequence Diagram Properties
« on: February 26, 2004, 12:40:23 pm »
I am automating the creation of a word doc that pulls from EA. Specifically I am dumping the sequence diagrams out of EA into Microsoft Word. I can do that just fine. The problem I am having is in accessing the collaboration messages property. I can’t find it in the documentation. I basically want to create the same table that is created using the Rich Text Documentation Export feature on sequence diagrams in Enterprise Architect that lists out all the messages of a sequence diagram in a table. Just can't find out where the  ID, Message, From Object, To Object and Notes properties are in the API. Thanks.

renoyl

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Sequence Diagram Properties
« Reply #1 on: February 27, 2004, 04:15:59 pm »
Ok so I have all the messages listing out after my sequence diagram, my only issue is that it lists ALL of the connector messages that reside an any given sequence diagram. So if I have a business object like ApplicationState that sits on a sequence diagram, when I try to list out just the sequence of steps in the diagram using the connectors, I get a list of all instances of that connector on every diagram.

How can I specify that I just want the connectors that appear on a specific sequence diagram in the order that they are placed on the diagram? It is the same thing that the RTF generation outputs for a sequence diagram.

LNS_Software

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Sequence Diagram Properties
« Reply #2 on: March 02, 2004, 10:09:33 am »
I to am evaluating the sequence diagram, as I have a standard I use to represent my interactions.  (Allows me to generate code and scan for defects in my specifications).

The order in which the elements appears on a sequence diagram appears to be controlled by the "Connector.SequenceNo" attribute.  Each connector consists of a supplier and a client, which means there are two entries for every message.  I cannot seem to tell the difference between the two Connector instances, and there may not be any difference.

I think the answer for you is that you have to create a list of connectors, that is unique by SequenceNo.  If you come across another connector with the same SequenceNo, ignore it.  After processing the diagram, order the list by SequenceNo, and you have your list of entries in the order they are specified on the diagram.

renoyl

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Sequence Diagram Properties
« Reply #3 on: March 03, 2004, 01:07:51 pm »
I should clarify. When I list out all the connectors on a sequence daigram all connectors are listed, even ones not on the sequence diagram that I am accessing. When you list out all connectors (the only way to get at them as a property of diagramobects) there will be a number of connectors with similar sequenceno properties, and there is no way to tell the difference  between them. Take an actor named user. User could have 15 connectors and you could have more than one with similar sequenceno properties and no way to tell what diagram they belong to. That is the real issue I think, no way to match a connector to a diagram. HELP EA!

renoyl

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Sequence Diagram Properties
« Reply #4 on: March 03, 2004, 05:13:32 pm »
So I created a little .net app to interate through some of the sequence diagrams in the eaexample.eap that ships with EA.  Interestingly, the diagramlinks collection associated with a diagram do not always show up in the diagramlinks collection. The example below (it's just a form with one button) drills down to the Manage Contacts package  and loads the CreateContact Sequence Diagram. The DiagramLinks count is 0 for this diagram even though there are a bunch of diagramlinks on the page. If I do the same things on another sequence diagram, such as the "SE0002 Setup " sequence diagram in EAExample.eap, all of the diagramlinks come back and the count is 14. I wish someone would explain this to me!!


    Dim Package As EA.Package
       Dim EARepos As New EA.Repository
       EARepos.OpenFile("C:\Program Files\Sparx Systems\EA\EAExample.eap")
       Package = EARepos.Models.GetByName("Messenger")
       Package = Package.Packages.GetByName("Model Views")
       Package = Package.Packages.GetByName("Analysis Model")
       Package = Package.Packages.GetByName("Use Case Collaborations")
       Package = Package.Packages.GetByName("Manage Contacts")

       Dim idx As Integer, diag As EA.Diagram


       For idx = 0 To Package.Diagrams.Count - 1
           Dim idx2 As Integer, DiagramName As String
           diag = Package.Diagrams.GetAt(idx)
           DiagramName = diag.Name

           For idx2 = 0 To diag.DiagramLinks.Count - 1
               Dim CurrDiagramLink As EA.DiagramLink
               CurrDiagramLink = diag.DiagramLinks.GetAt(idx2)
               Dim ini As Long
               ini = CurrDiagramLink.ConnectorID
               Dim CurrConnector As EA.Connector, CurrConnectorName As String
               CurrConnector = EARepos.GetConnectorByID(ini)
               CurrConnectorName = CurrConnector.Name

           Next
       Next

LNS_Software

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Sequence Diagram Properties
« Reply #5 on: March 08, 2004, 12:13:13 am »
I've looked at both diagrams you are referencing and as near as I can tell, I cannot see any difference between the two except for the fact that the documentation says that DiagramLinks contains display information.

This implies to me that unless there is some kind of special display information on at least one of the connectors that cannot be derived from the element definition for that connector, then all the connectors are described in DiagramLinks, whereas, they would normally be stored in DiagramObjects via Element and Connector.

I created a diagram called CreateContacts2 with an actor and a couple of objects and was unable to get my software to extract the DiagramLinks.  I looked through SE001 diagram and didn't see anything that stood out as being out of the ordinary.

I know I can get the connectors via the DiagramObjects, since it appears that the objects on the diagram are unique to that diagram.

Perhaps support can shed some light on this ...