Sparx Systems Forum

Discussion => Automation Interface, Add-Ins and Tools => Topic started by: Viking on December 09, 2017, 05:15:24 am

Title: GUID of a diagram
Post by: Viking on December 09, 2017, 05:15:24 am
Hello together,

I thought that finding out the GUID of a diagram without using a script is simple. But it is not. The property field is empty. The question has already been asked, but no answer was given: http://sparxsystems.com/forums/smf/index.php?topic=12845.0 (http://sparxsystems.com/forums/smf/index.php?topic=12845.0).

Could someody give me the answer, please? Many thanks in advance, V.

Title: Re: GUID of a diagram
Post by: qwerty on December 09, 2017, 10:08:19 am
Context menu: Copy GUID

q.
Title: Re: GUID of a diagram
Post by: Shegit Brahm on December 11, 2017, 06:36:27 pm
Sorry Viking,

you may expore your eap-file as database and find an ea_guid column inside table t_diagram - but that's only to fool you.

Diagrams don't have their own ea_guid.

If any is shown than the one from the package they are in. Because searching for the ea_guid of t_diagrams always leads me to the packages.

Cheers,
Shegit.
Title: Re: GUID of a diagram
Post by: Geert Bellekens on December 11, 2017, 07:01:49 pm
Sorry Viking,

you may expore your eap-file as database and find an ea_guid column inside table t_diagram - but that's only to fool you.

Diagrams don't have their own ea_guid.

If any is shown than the one from the package they are in. Because searching for the ea_guid of t_diagrams always leads me to the packages.

Cheers,
Shegit.

That is just wrong. Diagrams have guid's just like almost anything else in the EA world.

Geert
Title: Re: GUID of a diagram
Post by: Shegit Brahm on December 11, 2017, 07:42:01 pm
Well, I'm here to learn: please upload an eap-file with a few diagrams (at least one package with two diagrams) and list the ea-guids.

I use as guid-search this query:
select * from t_object where ea_guid like '*<Search Term>*'

If I understand you right, then I will find none of your guids with this query.

If I find all and they direct me to the package instead (using control + g as shortcut in resultlist)  - what else do I do wrong? I expect to find this guids only querying t_diagram.
Because whenever I switch from an element or package to a diagram and have properties window open all time, the shown guid either disappears or does not change.

Thanks,
Shegit

modified: more detailed description of my pov.
Title: Re: GUID of a diagram
Post by: Geert Bellekens on December 11, 2017, 08:19:02 pm
Shegit,

As mentioned before the properties window does not get filled in when you select a diagram in the project browser.
You can however right click on this diagram and select Copy/Paste | Copy Node GUID to clipboard to get the GUID of the diagram.

Geert

PS. I feel uncomfortable with the passive-aggressive tone in your post. :(
Title: Re: GUID of a diagram
Post by: Shegit Brahm on December 11, 2017, 08:30:51 pm
Hi Geert,

thanks for your repeat how to get it and I see that my way to get a diagram's guid is broken.

I'm sorry that I made you uncomfortable and I apologize for my tone. Thank you for raising this issue.

(it is based in my personal frustation with wrong usage and "gui bug" - so never ever a reason to get aggressive against you)

Thanks,
Shegit
Title: Re: GUID of a diagram
Post by: Viking on December 11, 2017, 08:59:27 pm
Thank you very much !!! Thanks also to the learners. I am also here to learn  :)
Title: Re: GUID of a diagram
Post by: qwerty on December 12, 2017, 01:29:57 am
I use as guid-search this query:
select * from t_object where ea_guid like '*<Search Term>*'

With that you search in the elements, so no wonder you get only packages. (It's a bit like the drunken man searching the lost keys for the house under the street light - not because he lost them there, but because the light is better. LOL)

To find diagram guids you need something like

Code: [Select]
select * from t_diagram where ea_guid like '*<Search Term>*'
q.
Title: Re: GUID of a diagram
Post by: Simon M on December 12, 2017, 08:28:43 am
Just to extend the idea of a guid search, here's an example of how that might look if you wanted to search across multiple tables.

Code: [Select]
select ea_guid AS CLASSGUID, Diagram_Type as CLASSTYPE, 't_diagram' as CLASSTABLE, Name, Author, CreatedDate, ModifiedDate, ea_guid as GUID from t_diagram where ea_guid like '*<Search Term>*'
union
select ea_guid AS CLASSGUID, Object_Type as CLASSTYPE, 't_object' as CLASSTABLE, Name, Author, CreatedDate, ModifiedDate, ea_guid as GUID from t_object where ea_guid like '*<Search Term>*'
union
select ea_guid AS CLASSGUID, 'Attribute' as CLASSTYPE, 't_attribute' as CLASSTABLE, Name, null, null, null, ea_guid as GUID from t_attribute where ea_guid like '*<Search Term>*'
union
select ea_guid AS CLASSGUID, 'Operation' as CLASSTYPE, 't_operation' as CLASSTABLE, Name, null, null, null, ea_guid as GUID from t_operation where ea_guid like '*<Search Term>*'
order by 4

Title: Re: GUID of a diagram
Post by: qwerty on December 12, 2017, 09:16:25 am
As a post-note: the "*" should be replaced by "#wc#" so it will work also on non MS Access (aka EAP) RDBMS.

q.
Title: Re: GUID of a diagram
Post by: Geert Bellekens on December 12, 2017, 03:22:09 pm
As a post-note: the "*" should be replaced by "%wc%" "#WC#" so it will work also on non MS Access (aka EAP) RDBMS.

q.
FTFY

Geert
Title: Re: GUID of a diagram
Post by: Glassboy on December 13, 2017, 07:32:15 am
When I see #WC# all I can think of is the plan notation for water closet.
Title: Re: GUID of a diagram
Post by: qwerty on December 13, 2017, 08:17:27 am
Thanks, Geert. I corrected that.

q.