Book a Demo

Author Topic: Seach Model by GUID?  (Read 6379 times)

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Seach Model by GUID?
« on: March 12, 2009, 11:27:05 am »
I assume there is a way to search for an object by its GUID, but I cant seem to find it.  Is there?

Thanks.
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Seach Model by GUID?
« Reply #1 on: March 12, 2009, 11:45:09 am »
You could create a Custom SQL Search with the following query

Code: [Select]
SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, Name
FROM t_object
WHERE t_object.ea_guid = '<Search Term>'
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Seach Model by GUID?
« Reply #2 on: March 12, 2009, 11:48:13 pm »
Yes a custom search works, but only with v6.5.  I found that in v7.0/7.1 the custom search feature truncates the search term to a certain length which means that you can't enter an entire GUID.  I raised a bug report (which Sparx initially said was a feature request!), but I think they've addressed this in the EA7.5 beta anyway.

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Seach Model by GUID?
« Reply #3 on: March 13, 2009, 04:43:29 am »
You're right I just tried it.  Have you tried to see if it works in the 7.5 betas?

P.S.  The only reason I need this feature is to get around a bug in the Compare Utility which drops the Source name of all Links.  So I'm looking in the XML and I found the Source GUID, and then am trying to search by that.
« Last Edit: March 13, 2009, 04:45:26 am by dworkman »
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Seach Model by GUID?
« Reply #4 on: March 13, 2009, 05:14:47 am »
No I just saw it mentioned in the list of changes.

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Seach Model by GUID?
« Reply #5 on: March 13, 2009, 08:27:22 am »
I tried the search in 7.5 and it seemed to work there without truncating the search term.

Alternatively if you have 7.5 you could open a Javascript console and use the type the following command:

Code: [Select]
Session.Output( Repository.GetElementByGuid("{E3FB786F-F882-4d4d-BDD1-393995D14886}").Name );
« Last Edit: March 13, 2009, 08:29:55 am by mfraser »
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Seach Model by GUID?
« Reply #6 on: March 13, 2009, 10:53:33 am »
Thanks, we're not running 7.5 until it goes final, but will try it then.
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Seach Model by GUID?
« Reply #7 on: March 13, 2009, 11:09:31 am »
Ah ok no problems. In the meantime (and this won't be 100% accurate) you could try this:

Code: [Select]
SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, Name
FROM t_object
WHERE t_object.ea_guid LIKE '<Search Term>#WC#'

which will try and match as much of the search term as it can to the t_object.ea_guid field (the #WC# macro inserts the wildcard for the current database).
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Seach Model by GUID?
« Reply #8 on: March 14, 2009, 04:21:21 am »
Thanks!
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman