Author Topic: Issues with GUID of onnectors / relationships  (Read 3168 times)

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Issues with GUID of onnectors / relationships
« on: May 23, 2025, 06:04:55 pm »
Hi, I thought that my issues are simple. But I do not find answers.
(1) Does a connector / relationship have a GUID?
(2) If yes, how can I find the GUID of a connector / relationship in v17 or v16 without using scripts? There is no "copy"-command and nothing in the properties.
(3) How can I find the diagrams a connector / relationship is shown (visible)? The reason for this question is that I want to find out, if a “wrong” connector / relationship has been created intentionally.
(4) The export an element with XML. The GUID is part of a tagged value (in my case CLT:{{}) and does not have an own attribute. Does this make sense? Which one?
V.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Issues with GUID of onnectors / relationships
« Reply #1 on: May 23, 2025, 06:33:34 pm »
Hi, I thought that my issues are simple. But I do not find answers.
(1) Does a connector / relationship have a GUID?
Yes
Quote
(2) If yes, how can I find the GUID of a connector / relationship in v17 or v16 without using scripts? There is no "copy"-command and nothing in the properties.
best to use a query in the model search if you don't want to use scripting
Code: [Select]
select * from t_connector c
inner join t_object o on o.Object_ID in (c.Start_Object_ID, c.End_Object_ID)
where o.ea_guid = '<guid of connected element>'
Quote
(3) How can I find the diagrams a connector / relationship is shown (visible)? The reason for this question is that I want to find out, if a “wrong” connector / relationship has been created intentionally.
again best to use a search
Code: [Select]
select * from t_diagram d
inner join t_diagramlinks dl on dl.DiagramID = d.Diagram_ID
inner join t_connector c on c.Connector_ID = dl.ConnectorID
inner join t_object o on o.Object_ID in (c.Start_Object_ID, c.End_Object_ID)
where dl.Hidden = 0
and o.ea_guid = '<guid of connected element>'
Quote
(4) The export an element with XML. The GUID is part of a tagged value (in my case CLT:{{}) and does not have an own attribute. Does this make sense? Which one?
V.
I don't know what you mean by that.

Geert

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Issues with GUID of onnectors / relationships
« Reply #2 on: May 23, 2025, 09:00:54 pm »
Many thanks, Geert.

Geert: "I don't know what you mean by that: "(4) The export an element with XML. The GUID is part of a tagged value (in my case CLT:{{}) and does not have an own attribute.""

I am sorry. Definitely it is not possible to understand it. The correct sentence should be: "(4) I exported a diagram as XML. In this XML-file, the GUID is part of a tagged value (in my case CLT:{{}). I would have expected an own attribute." So, this is not really a question.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Issues with GUID of onnectors / relationships
« Reply #3 on: May 23, 2025, 09:08:10 pm »
Many thanks, Geert.

Geert: "I don't know what you mean by that: "(4) The export an element with XML. The GUID is part of a tagged value (in my case CLT:{{}) and does not have an own attribute.""

I am sorry. Definitely it is not possible to understand it. The correct sentence should be: "(4) I exported a diagram as XML. In this XML-file, the GUID is part of a tagged value (in my case CLT:{{}). I would have expected an own attribute." So, this is not really a question.
I see. The reason is that the unique ID is not part of the xmi standard (as are many more of the EA specific things).
So EA has to use the extension mechanism (tagged values) to store those non standard xmi things.

Also one of the reasons why the xmi exchange format only really exchanges the basics when used between different tools.
Each tool stores it's non-standard stuff in a different way.

Geert

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Issues with GUID of onnectors / relationships
« Reply #4 on: May 23, 2025, 09:17:42 pm »
Thanks Geert. Very helpful.

Takeshi K

  • EA User
  • **
  • Posts: 593
  • Karma: +39/-1
    • View Profile
Re: Issues with GUID of onnectors / relationships
« Reply #5 on: May 26, 2025, 10:20:10 am »
About the question (3) of the first port, with Enterprise Architect features we can use the following:

- The Relationships dockable window (check/modify for a selected element)
- The Set Visible Relationships feature (check/modify for a current diagram)

HTH,
--
t-kouno

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Issues with GUID of onnectors / relationships
« Reply #6 on: June 06, 2025, 09:11:30 pm »

I get an missing operator error. I cannot find it :-( I am using MariaDB and eapx.

select * from t_diagram d inner join t_diagramlinks dl on dl.DiagramID = d.Diagram_ID inner join t_connector c on c.Connector_ID = dl.ConnectorID inner join t_object o on o.Object_ID in (c.Start_Object_ID, c.End_Object_ID) where dl.Hidden = 0 and o.ea_guid = '{BEFFA34C-4A29-46d0-AE21-96723A6FEC29}';
« Last Edit: June 06, 2025, 09:16:48 pm by Viking »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Issues with GUID of onnectors / relationships
« Reply #7 on: June 06, 2025, 10:32:50 pm »

I get an missing operator error. I cannot find it :-( I am using MariaDB and eapx.

select * from t_diagram d inner join t_diagramlinks dl on dl.DiagramID = d.Diagram_ID inner join t_connector c on c.Connector_ID = dl.ConnectorID inner join t_object o on o.Object_ID in (c.Start_Object_ID, c.End_Object_ID) where dl.Hidden = 0 and o.ea_guid = '{BEFFA34C-4A29-46d0-AE21-96723A6FEC29}';
for .eapx you should add parentheses around the different joined tables. Not sure why MariaDB should have an issue with this syntax.
To figure out where it goes wrong, strip the query down to the simplest one that works, and then start adding in the joins.

Geert

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Issues with GUID of onnectors / relationships
« Reply #8 on: June 07, 2025, 01:12:10 am »
My bad, Geert. Works for MariaDB now. Have to check for JET now. Thank you.
« Last Edit: June 08, 2025, 04:05:21 am by Viking »

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Issues with GUID of onnectors / relationships
« Reply #9 on: June 09, 2025, 02:02:11 am »
My bad, Geert. Works for MariaDB now. Have to check for JET now. Thank you.

Only the technical issue is gone. But I get an empty result set with the query from Geert.
 
I tried another option and got the expected result. I wanted to post it, but the forum-software blocks to insert a sql-statement (insert code).
« Last Edit: June 09, 2025, 02:53:04 am by Viking »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Issues with GUID of onnectors / relationships
« Reply #10 on: June 09, 2025, 05:51:31 pm »
I tried another option and got the expected result. I wanted to post it, but the forum-software blocks to insert a sql-statement (insert code).
Yeah, I noticed that too a while ago. I already emailed Sparx support about it.

Geert

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Issues with GUID of onnectors / relationships
« Reply #11 on: June 09, 2025, 11:30:03 pm »
Here is the statement that worked. @Geert, it would be great if you could check it, if it is correct and why yours did not work.

Code: [Select]
SELECT d.ea_guid AS DiagramName
FROM t_diagramlinks dl
JOIN t_diagram d ON dl.DiagramID = d.Diagram_ID
WHERE dl.ConnectorID = (SELECT ConnectorID FROM t_connector WHERE ea_guid = '<GUID>');

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Issues with GUID of onnectors / relationships
« Reply #12 on: June 10, 2025, 04:18:13 pm »
My query is based on the guid of a connected element (something you can get from the GUI), and not the guid of the connected element
Since connector guids are not available, the element guid is the next best thing.

Your current query is a bit weird with the subquery. I would simply join t_connector as well

Code: [Select]
SELECT d.ea_guid AS DiagramName
FROM t_diagramlinks dl
JOIN t_diagram d ON dl.DiagramID = d.Diagram_ID
join t_connector c on c.connectorID = dl.ConnectorID
WHERE c.ea_guid = '<GUID>'

Geert

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: Issues with GUID of onnectors / relationships
« Reply #13 on: June 10, 2025, 07:52:55 pm »

The GUID of the connector is available (with your help, by the way). Do you mind to correct my query? I do not get yours to run.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Issues with GUID of onnectors / relationships
« Reply #14 on: June 10, 2025, 09:38:13 pm »

The GUID of the connector is available (with your help, by the way). Do you mind to correct my query? I do not get yours to run.
I did correct it. Where doesn't it run? on .eap you have to add parentheses
Code: [Select]
SELECT d.ea_guid AS DiagramName
FROM ((t_diagramlinks dl
JOIN t_diagram d ON dl.DiagramID = d.Diagram_ID)
join t_connector c on c.connectorID = dl.ConnectorID)
WHERE c.ea_guid = '<GUID>'

Geert