Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Viking 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.
-
Hi, I thought that my issues are simple. But I do not find answers.
(1) Does a connector / relationship have a GUID?
Yes
(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
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>'
(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
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>'
(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
-
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.
-
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
-
Thanks Geert. Very helpful.
-
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,
-
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}';
-
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
-
My bad, Geert. Works for MariaDB now. Have to check for JET now. Thank you.
-
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).
-
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
-
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.
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>');
-
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
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
-
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.
-
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
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
-
It did neither work on eap nor on MariaDB. I will try again.
-
Hi @Geert, many thanks for your patience. On my installation these attributes doe not exist:
SELECT * FROM t_diagramlinks -> t_diagramlinks does not have a Connector_lD, use Instance_ID instead
SELECT * FROM t_connector -> t_connector does not have a ConnectorID, but a Connector_ID instead
So this SQL-statement works:
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.Connector_ID = dl.Instance_ID)
WHERE c.ea_guid = '{BEFFA34C-4A29-46d0-AE21-96723A6FEC29}'
I thought that I was using the newest schema. I just set it up newly yesterday.
-
Instance_ID is something else. You need connectorID
I just verified, and this one actually works
SELECT *
FROM ((t_diagramlinks dl
JOIN t_diagram d ON dl.DiagramID = d.Diagram_ID)
join t_connector c on c.Connector_ID = dl.ConnectorID)
WHERE c.ea_guid = '{BEFFA34C-4A29-46d0-AE21-96723A6FEC29}'
The schema is unfortunately not consistent with the usage of underscores. Most of the times there's an underscore in "_ID" but sometimes not.
Geert
Geert
-
@Geert, I got yours to work. But I had to change c.connectorID into c.connector_ID.