Book a Demo

Author Topic: ElementID in User Templates  (Read 4632 times)

pieter.vanderzwet

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
ElementID in User Templates
« on: June 09, 2016, 11:55:54 pm »
Currently we are using our own EA document templates for generating documents out of EA. We use this a.o. to generate requirements documents. Now, we have customers with a traditional view on requirements and they want a unique identification for each requirement. The identification should not change, and, if a requirement is removed, it shall not be reused for another requirement.

My idea was to use the ElementID as part of the identification: you would then get something like <projectid>-<reqtype>-<ElementID> for identification.

But despite the fact an ElementID exists (it is of type long in the documentation) I have not found a way to include it in the document. I have used Element.ValueOf(ElementID) but that remains empty in the document. Note my implicit assumption is that Sparx does not reuse ElementIDs once an element with that ID has been removed from the model.

Anyone who has encountered the same problem and has found a solution? Many thanks

VKN

  • EA User
  • **
  • Posts: 187
  • Karma: +9/-1
    • View Profile

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: ElementID in User Templates
« Reply #2 on: June 10, 2016, 12:48:49 pm »
Pieter,

Forget all your assumptions about the elementID. You should never ever use this as an identifier as you cannot trust them to remain the same in the model.
There's even a function in EA to re-number the elementIDs.

You can trust the ea_guid, but that is usually not fit for human consumption. In any other case you best go with the auto-naming feature.
If you use the alias i.s.o. the name then you can be reasonably sure that this will remain stable.

Geert