Author Topic: EA_Guid of 'current element' in an SQL search  (Read 32399 times)

wivel

  • EA User
  • **
  • Posts: 242
  • Karma: +12/-1
  • Driven by Models
    • View Profile
EA_Guid of 'current element' in an SQL search
« on: April 08, 2024, 04:19:49 am »
Hi

Is there anyway, that I in a Custom SQL of a ModelView, have access to the EA Guid of the ModelView Element itself? Or is there a clever way of obtaining it tha I have missed? I would like the make a generic table, that can be 'plugged-in' on several diagrams, without having to physically change the EA GUID in the search for each copy I make.

Henrik

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA_Guid of 'current element' in an SQL search
« Reply #1 on: April 08, 2024, 08:52:48 am »
It's the one tha has no parent...

q.

wivel

  • EA User
  • **
  • Posts: 242
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: EA_Guid of 'current element' in an SQL search
« Reply #2 on: April 08, 2024, 09:33:57 pm »
It's the one tha has no parent...

q.
Hmmmm. Would the ModelView element not have a parent when it is added to a diagram? According to the t_object table it does have a parent.

Henrik 

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13283
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA_Guid of 'current element' in an SQL search
« Reply #3 on: April 08, 2024, 09:59:53 pm »
I haven't found a better solution yet.

I did write a script a while ago for a client to create a modelview on a diagram.
In this script I set the correct GUID for the query.

Geert

wivel

  • EA User
  • **
  • Posts: 242
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: EA_Guid of 'current element' in an SQL search
« Reply #4 on: April 08, 2024, 11:12:45 pm »
I haven't found a better solution yet.

I did write a script a while ago for a client to create a modelview on a diagram.
In this script I set the correct GUID for the query.

Geert
Doing the same thing, but its error prone, especially when handing over maintenance to others. Even if it is well documented, if I have to say so myself ;).

What I would like to see is something like #SelfID# and #SelfGUID# macros.

Henrik
« Last Edit: April 09, 2024, 03:41:44 am by wivel »