Book a Demo

Author Topic: What format are the Sparx generated Profile Ids?  (Read 7744 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
What format are the Sparx generated Profile Ids?
« on: August 13, 2021, 03:46:00 pm »
Hi all

If we look at a UML profile in the MDG (example shown below), we can see an "id" which MUST be globally unique otherwise Sparx has a big ole whinge about duplicate ids.
My question is, how are they generated and is there any rules you must follow?
Or can I simply put a GUID in there?


<UMLProfile profiletype="uml2">
   <Documentation id="FCE5A61E-F" name="PRCMDG" version="2.0" notes="PRCMDG"/>

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What format are the Sparx generated Profile Ids?
« Reply #1 on: August 13, 2021, 08:10:37 pm »
It's simply a GUID.

q.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: What format are the Sparx generated Profile Ids?
« Reply #2 on: August 14, 2021, 02:36:30 am »
Hey Q
The guids that Macrosoft use are about 3 times longer.
If I use those instead, will it matter?
I am wanting to do this when auto generating mdgs.
Cheers

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What format are the Sparx generated Profile Ids?
« Reply #3 on: August 14, 2021, 03:46:59 am »
You can simply shorten it. Sparxians also use partially shortened GUID elsewhere (e.g. for stereotype properties). They are less significant. But if you make it a decimal you see that it's a huge number and very unlikey there'll be that much MDGs around. The random number generator is quit good these days. Duplicate GUIDs are possible, but very, very unlikely.

q.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: What format are the Sparx generated Profile Ids?
« Reply #4 on: August 14, 2021, 10:18:44 am »
Cheers q

Do you know of any bad effects that might occur if I simply use the Macrosoft guid?

Just looking to be lazy as possible ;-)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What format are the Sparx generated Profile Ids?
« Reply #5 on: August 14, 2021, 06:53:08 pm »
All GUID generators have more or less the same algorithm in their guts. Just go for Mickeysoft's implementation if you like :-)

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: What format are the Sparx generated Profile Ids?
« Reply #6 on: August 16, 2021, 07:42:32 am »
If you 'Publish Package as UML Profile', the ID is the first 10 characters of the package's GUID. If you 'Publish Diagram as UML Profile', the ID is the first 10 characters of the diagram's GUID. If you're generating by your own methods, you can put whatever you want in there, but I'd recommend you stick to 10 characters alphanumeric - there may or may not be a catch in the code somewhere...
« Last Edit: August 16, 2021, 07:48:49 am by KP »
The Sparx Team
[email protected]