Book a Demo

Author Topic: Operations: Linking From&To Sequence  (Read 4156 times)

KtX2SkD

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Operations: Linking From&To Sequence
« on: December 02, 2012, 04:15:45 am »
Hello. In short, here's a scenario illustrating my problem:
  • Create a bunch of classes and their corresponding operations.
  • Create a bunch of sequences and reuse the already created operations.
  • Problem: See from the class model which sequence diagrams are using a specific operation?
Why? Well, deleting operations from the class model will still leave the sequence diagrams unmodified, which basically means the presence of unlinked operations there.

Also, if I'm to relocate the operation to a different class, that also triggers the problem...

Edit: It would also be good to know a way of checking if there's any unlinked operations in the sequence diagrams as well.

Would be happy for any assistance.
« Last Edit: December 02, 2012, 04:16:55 am by ktx2skd »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Operations: Linking From&To Sequence
« Reply #1 on: December 03, 2012, 12:31:35 am »
There is nothing out-of-the-box, but several solutions: one is to write a query finding diagrams using operations (like on page 72 of my book Inside EA). A second is an organizational. Add diagrams inside the class which contain links to the appropriate sequence diagrams.

You might think of an add-in which checks the model via EA_OnPreDeleteMethod to react accordingly.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Operations: Linking From&To Sequence
« Reply #2 on: December 03, 2012, 08:56:55 am »
The Find in Diagrams (Ctrl+U) function can be used from a selected operation to find where it appears on a sequence diagram. You'll need to find the operation in the Project Browser.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Operations: Linking From&To Sequence
« Reply #3 on: December 03, 2012, 07:24:26 pm »
I've written an SQL search exactly for this purpose.

Code: [Select]
select distinct d.ea_guid as CLASSGUID,d.Diagram_Type as CLASSTYPE,d.Name as Diagram,m.Name as Message, m.SeqNo,d.Author
from ((((t_connector m
join t_diagram d on m.DiagramID = d.Diagram_ID
left join t_connectortag mt on mt.ElementID = m.Connector_ID
                                             and mt.Property = 'operation_guid')
left join t_operationtag ot on ot.VALUE = mt.VALUE
                                                and ot.Property = 'ea_guid')
left join t_operation o on mt.VALUE = o.ea_guid)
left join t_operation o2 on ot.ElementID = o2.OperationID)

where m.Connector_Type = 'Sequence'
and o.OperationID is null
and o2.OperationID is null
order by d.name, m.SeqNo

You can also use the EA Navigator to quickly see whether or not an operation is still used on a diagram, or to quickly see if a message is calling an existing operation.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Operations: Linking From&To Sequence
« Reply #4 on: December 03, 2012, 09:43:28 pm »
Quote
Edit: It would also be good to know a way of checking if there's any unlinked operations in the sequence diagrams as well.
Tough. Only with quite a bit programming you can find that out. The messages are just strings an not linked in any form. So you need to do a string compare of the message name with all operations of the class.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Operations: Linking From&To Sequence
« Reply #5 on: December 03, 2012, 10:27:00 pm »
Quote
Quote
Edit: It would also be good to know a way of checking if there's any unlinked operations in the sequence diagrams as well.
Tough. Only with quite a bit programming you can find that out. The messages are just strings an not linked in any form. So you need to do a string compare of the message name with all operations of the class.

q.
That is not true.
The connectors have a hard link to the operation in the form of a tagged value containing a GUID.
So it can even happen that the name of the message corresponds exactly with the name of the operation, but that for some reason (like moving operations from one class to another) the real link has been lost.

In that case the "find in diagrams" function on the operation won't work, and neither will the EA Navigator.

Geert

KtX2SkD

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Operations: Linking From&To Sequence
« Reply #6 on: December 09, 2012, 11:24:17 am »
Remarkable, there's like four or five approaches for this problem.

Well thanks for everybody's input, I'm surely going to get back and reread the replies by detail, but not right now, as our project is in a bit of a "situation".

If I manage, I might write an applet or whatsoever that automates these tasks and upload it here.

Thanks again, cheers.