Book a Demo

Author Topic: How to generate a tagged value's guid so that it is mapped to the stereotype  (Read 3475 times)

Hauke Wittern

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Does anyone know how to generate the first half of a tagged value's guid without using the EA Api? I am going to write these to the ea_guid column of the t_attributetag, t_objectproperties etc. database tables. The tagged value must be mapped to the stereotype (defined in my MDG technology). Hence, I cannot just program it like "new GUID().ToString()". Apparently, the fully qualified name of  the tagged value must somehow be encoded into the first half (8 bytes) of the guid. This was discussed almost 10 years ago. There is also a topic that indicates that it can be done but the solution was unfortunatelly not shared.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
I think you'll have to hard-code that first part.
(create one manually, check the first part, and put that into your code)

I don't know your use case, but creating stuff in the database directly is in most cases not the best solution.
Much easier to let EA create the tagged values for you

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
I started to hack these last year (after someone asked for it) but then had to stop working on it. I'll restart as soon as time permits. In the meantime: you can only manually get the code. You have to have EA create a TV from the GUI. Then you take that prefix and save it for you code as constant string. You need to replace the part of the created stereotype property GUID so EA recognizes them. Once I (hopefully) got behind the coding I will publish that info. I have not the faintest idea why this needs to be a secret algorithm. Maybe a Sparxian can comment.

q.

Hauke Wittern

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
OK then I'll solve this by generating dummy tagged values and reading their guids. Nevertheless it would be nice if Sparx publishes their algorithm.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Yes, it would. Sometimes a nice guy from Sparx spreads insider news here. If I only knew how to make that person happy again ;-)

q.