Author Topic: What is the rule for generating GUIDs for tag values in a profile?  (Read 2419 times)

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
I want to implement a piece of code (outside EA and the API) that creates directly in the database an Element. The element is of a given stereotype defined in a profile in a custom MDG.

So, I have to insert into the database the suitable data for t_object (the Element), t_xref (the Tag value grouping and stereotypes) and t_objectproperties (the tag values). But I have noticed that generating random GUIDs for the tag values generates some problems in the resulting element because the tags don't get grouped and are only visible in the tag section of the Properties window, instead of be visible in the main Properties tab.

I have also noted that all the elements generated manually (using EA) have some coincidences in some parts of the tag value GUID. I mean, if I have several tag values defined in the stereotype (city, company, category, etc), all the "city" tag values for different elements share some section of the GUID. Also, any of the tag values defined in the same profile (or MDG) share some other section of the GUID.

In a given GUID structure like this: {AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}
All the tag values of elements with stereotypes belonging to the same MDG/profile, shares the AAAAAAAA section.
All the tag values with the same name (city, company, category, etc), shares the BBBB-CCCC sections
Only DDDD-EEEEEEEEEEEE seems to be randomly generated.

Does anybody know the rule to calculate AAAAAAAA and BBBB sections of the GUID for a tag value?

wivel

  • EA User
  • **
  • Posts: 242
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: What is the rule for generating GUIDs for tag values in a profile?
« Reply #1 on: July 08, 2023, 06:00:57 am »
I would strongly advise against creating elements directly in the database, not using the EA API. The internal 'magic' that happens in EA is Sparx IP and not documented for os mere mortals.

Henrik

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: What is the rule for generating GUIDs for tag values in a profile?
« Reply #2 on: July 08, 2023, 08:26:42 am »
The rule is secret (Sparx proprietary). I once was about to crack it but then had other stuff and lost it. The only way is to create a tag with the GUI and look at the GUID and use that hard coded. Clumsy but works. Maybe in winter I will look into this again. Maybe...

q.

philchudley

  • EA User
  • **
  • Posts: 736
  • Karma: +20/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: What is the rule for generating GUIDs for tag values in a profile?
« Reply #3 on: July 10, 2023, 07:51:13 pm »
I agree do not create elements directly in the database without using the EA API.

I also believe creating elements directly in the database without using the EA API, contravenes the EA licence agreement, so maybe worth check that out.

Phil
follow me on Twitter

@SparxEAGuru

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: What is the rule for generating GUIDs for tag values in a profile?
« Reply #4 on: July 10, 2023, 11:36:03 pm »
Well, the database is mine. So what is within is mine too. And how I put it in is my obligation. It's just that Sparx will give you no support for not using the API but your own code.

q.