Author Topic: Sequence Diagram: Discover Message Nesting  (Read 3111 times)

scott2012

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Sequence Diagram: Discover Message Nesting
« on: February 15, 2012, 07:05:42 am »
I have been able to extract messages in sequence diagrams. Once I have the connector, I can get the client and supplier classifiers. Now I need to deal with message/method nesting. For instance:

Message1 from one Class1 to Class2 starts a method-box on the lifeline of Class2. Now assume that there is a Message2 in that method-box which goes from Class2 to Class3.

This means that Message2 is called from within Message1.  How do I discover this using the API?  I looked at the ConnectEnds and one would expect that SupplierEnd of Message1 would be the same as the ClientEnd of Message2. However, this isn’t the case. All ConnectorEnds appear to be unique.

So, how do I discover that Message2 is being called from within Message1? Any help is greatly appreciated.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Sequence Diagram: Discover Message Nesting
« Reply #1 on: February 15, 2012, 06:39:08 pm »
How I would try to find out:

-Start a new model with only one sequence diagram
-Put both a message that starts from a nested location, and a message that starts from the lifeline base on the diagram
- Open the eap file with ms-access (or any other sql client that can read access files) and inspect the tables to figure out what exactly is different. (start at t_connector and t_diagramlinks)
- If you have found the difference in the database then try to match the column with a field on the API object.

Then post the results of your investigation on this forum :)

Geert

philchudley

  • EA User
  • **
  • Posts: 744
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Sequence Diagram: Discover Message Nesting
« Reply #2 on: February 16, 2012, 12:00:01 am »
Hi Guys

I like a challenge  :)

After a a bit of playing around, one possible solution is

1) Obtain the messages in sequence order [highlight](t_connector.SeqNo[/highlight])
2) Iterate the messages
3) Obtain the end object id ([highlight]t_connector.End_object_ID[/highlight]) let's call it [highlight]END[/highlight]
4) The calls for the current message will be the following messages where it's [highlight]t_connector.Start_object_ID = END[/highlight]

The process above could then be repeated for each call identified or indeed made recursive

Hope this makes some sense

Cheers

Phil
Models are great!
Correct models are even greater!

scott2012

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Sequence Diagram: Discover Message Nesting
« Reply #3 on: February 16, 2012, 09:18:26 am »
Thank you sir:exclamation I believe that that's the right idea. The exact algorithm will have to take multiple nesting into account. But it should work.