Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: ajread29 on April 02, 2024, 11:28:19 pm

Title: Export Class Associations with labels/alias included
Post by: ajread29 on April 02, 2024, 11:28:19 pm
I have drawn a class diagram, connected the relevant classes and labelled the relationships accordingly. I can't find any way to display all associations to a class including their labels. i.e. tire sensor class is associated to tire class and label is 'measures'.

When using the relationship matrix i can export to CSV but can't display labels or aliases. When using relationship view I can see the labels but can't export!

Any help appreciated.
Title: Re: Export Class Associations with labels/alias included
Post by: Geert Bellekens on April 02, 2024, 11:50:22 pm
The easiest approach is to write an SQL search and then export the results of the search to CSV.

You'll need to query t_connector, t_object, t_diagramObjects and t_diagram (and possibly t_diagramLinks if you want to exclude hidden relations)

Geert
Title: Re: Export Class Associations with labels/alias included
Post by: ajread29 on April 03, 2024, 09:45:05 pm
Thanks Geert, appreciate the help.

I'm pretty new and have tried to look online but require a little further help.

I've gone to the diagram, pressed ctrl + F and got the find in project window up. I've then clicked Edit Search and then SQL Scratch Pad. I then pasted in the following...

select t_connector, t_object, t_diagramObjects and t_diagram

and nothing has happened. Am I doing something really stupid?

Thanks!
Title: Re: Export Class Associations with labels/alias included
Post by: shimon on April 03, 2024, 09:59:57 pm
Hi,
You need to learn some basic SQL. There are many online sources.
Maybe start here: https://www.w3schools.com/sql/

Shimon
Title: Re: Export Class Associations with labels/alias included
Post by: Geert Bellekens on April 03, 2024, 10:13:00 pm
I'll give you a starter query, but you'll have to figure out the rest yourself

Code: [Select]
select so.name as StartObject, c.Name as connectorName, c.StyleEx as HeresTheAlias, eo.Name as EndObject
from t_connector c
inner join t_object so on so.Object_ID = c.Start_Object_ID
inner join t_object eo on eo.Object_ID = c.End_Object_ID
inner join t_diagramobjects dos on dos.Object_ID = so.Object_ID
inner join t_diagramobjects doe on doe.Object_ID = eo.Object_ID
inner join t_diagram d on d.Diagram_ID = dos.Diagram_ID
and d.Diagram_ID = dos.Diagram_ID
where d.ea_guid = '{8B951B4F-0953-4519-9264-01867D5CEF74}'

Geert
Title: Re: Export Class Associations with labels/alias included
Post by: ajread29 on April 04, 2024, 02:38:25 am
Thank you both :)