Author Topic: How to parse sequence diagram?  (Read 6040 times)

futuros

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
How to parse sequence diagram?
« on: October 04, 2004, 03:26:28 am »
Hi,

can anybody give me a little tutorial, how to parse sequence diagram ? I can parse UC diagram, but this type of diagram is not important from order of view.

thank you

LNS_Software

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: How to parse sequence diagram?
« Reply #1 on: October 25, 2004, 02:33:03 pm »
As near as I can tell, the best way is to do the following:
  • For each diagram, you will have a DiagramID.
  • Scan through the DiagramObjects, and find the appropriate elements for each object.
  • Scan the connections for each element.
  • Only consider the sequence connections with a diagram ID you are currently evaluating.  (It appears that the diagram ID is only specified for "Sequence" and "Collaboration" messages, and set as zero for other types of diagrams.)
  • Sort the connectors according to SequenceNo.
This gives you the sequencial order of connectors on the diagram.  Unfortunately it appears that you cannot get the message activation details or to determine the hierarchical sequence numbers.

If your connector refers to an operation, the connector TAG "operation_guid" will identify the GUID for the operation.  You can get the details of the method by:
  • Determining the element on the supplier end of the connection.
  • Scanning through the MethodsEx for the element until you find a matching GUID.  (Note: Methods EX contains a list of all inherited methods, not just the ones created for the current class.)
I haven't been able to find a GetMethodByGUID call in the repository or class.

Have fun ...  :D

futuros

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: How to parse sequence diagram?
« Reply #2 on: October 25, 2004, 11:28:34 pm »
Thank you, I have solved this problem some time ago, but the other thing as "operation_guid" is new for me, so I sure I will use It in future.

:)


mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: How to parse sequence diagram?
« Reply #3 on: October 26, 2004, 07:12:57 am »
Or if the model is in a database, I guess you could parse the model data tables directly - if you knew where everything lives !!?

LNS_Software

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: How to parse sequence diagram?
« Reply #4 on: October 26, 2004, 08:42:47 am »
The only risk I can see in parsing the tables is if Sparx decides to change how they store stuff, your routines might fail.  At least there is consistency in the Automation interface, or at least I hope so.