Author Topic: GUID of a diagram  (Read 2785 times)

Viking

  • EA User
  • **
  • Posts: 247
  • Karma: +1/-2
    • View Profile
GUID of a diagram
« 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.

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

« Last Edit: December 11, 2017, 08:51:26 pm by Viking »

qwerty

  • EA Guru
  • *****
  • Posts: 9669
  • Karma: +176/-150
  • I'm no guru at all
    • View Profile
Re: GUID of a diagram
« Reply #1 on: December 09, 2017, 10:08:19 am »
Context menu: Copy GUID

q.

Shegit Brahm

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: GUID of a diagram
« Reply #2 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.
« Last Edit: December 11, 2017, 06:41:32 pm by Shegit Brahm »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8470
  • Karma: +207/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: GUID of a diagram
« Reply #3 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

Shegit Brahm

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: GUID of a diagram
« Reply #4 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.
« Last Edit: December 11, 2017, 07:54:56 pm by Shegit Brahm »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8470
  • Karma: +207/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: GUID of a diagram
« Reply #5 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. :(

Shegit Brahm

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: GUID of a diagram
« Reply #6 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

Viking

  • EA User
  • **
  • Posts: 247
  • Karma: +1/-2
    • View Profile
Re: GUID of a diagram
« Reply #7 on: December 11, 2017, 08:59:27 pm »
Thank you very much !!! Thanks also to the learners. I am also here to learn  :)

qwerty

  • EA Guru
  • *****
  • Posts: 9669
  • Karma: +176/-150
  • I'm no guru at all
    • View Profile
Re: GUID of a diagram
« Reply #8 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.

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6450
  • Karma: +55/-6
    • View Profile
Re: GUID of a diagram
« Reply #9 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

Simon

support@sparxsystems.com

qwerty

  • EA Guru
  • *****
  • Posts: 9669
  • Karma: +176/-150
  • I'm no guru at all
    • View Profile
Re: GUID of a diagram
« Reply #10 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.
« Last Edit: December 13, 2017, 08:16:52 am by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8470
  • Karma: +207/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: GUID of a diagram
« Reply #11 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

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1111
  • Karma: +77/-72
    • View Profile
Re: GUID of a diagram
« Reply #12 on: December 13, 2017, 07:32:15 am »
When I see #WC# all I can think of is the plan notation for water closet.

qwerty

  • EA Guru
  • *****
  • Posts: 9669
  • Karma: +176/-150
  • I'm no guru at all
    • View Profile
Re: GUID of a diagram
« Reply #13 on: December 13, 2017, 08:17:27 am »
Thanks, Geert. I corrected that.

q.