Book a Demo

Author Topic: Element Level Numbering Location  (Read 8097 times)

krogarth

  • EA Novice
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Element Level Numbering Location
« on: June 28, 2016, 06:51:34 pm »
Hi

We are currently using the feature on the right-click menu to apply the level numbering against all our requirement elements within a package. I'd like to output that same level number in the documentation from EA we produce already

Does anybody know please the table.field in Sparx EA database (v 12.1) so that I can create a custom document fragment for it? I presume it exists in the DB somewhere against the object_id or GUID and isn't just done in the app layer?

Thanks in advance for your advice

Dan


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Element Level Numbering Location
« Reply #1 on: June 28, 2016, 07:13:33 pm »
I'm not sure which element level numbering you are after. Can you explain please?

q.

krogarth

  • EA Novice
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Re: Element Level Numbering Location
« Reply #2 on: June 28, 2016, 08:14:49 pm »
Hi q

Thanks for the reply. Sure I'll try to explain the feature, unfortunately I can't easily post pictures

At the moment I have X number of requirements in my project browser organised in 1 package. This also works for activities, use cases etc. Basically any element in the project browser can have an auto level number.

Now I right click on the package in the project browser and choose the advanced menu within the right-click context menu. At the top of the list in the advanced menu is the option 'Turn On Level Numbering'. Enabling this option automatically applies parent/child style level numbers 1, 1.1, 1.1.1 etc to any element within that package I selected

I would like to output these level numbers (1, 1.1, 1.1.1 etc.) into the RTF document templates from Sparx. I am comfortable in creating the template fragments for it but need to know the Sparx EA DB table.field for those as I can't find them in t_object and not too familiar with the other tables

Thanks for your help

Dan



Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Element Level Numbering Location
« Reply #3 on: June 28, 2016, 08:36:17 pm »
I don't think the level numbering is stored anywhere.
I believe it is generated at runtime and only there for visual purposes, but I could be wrong of course.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Element Level Numbering Location
« Reply #4 on: June 28, 2016, 08:44:58 pm »
I can confirm what Geert said. This numbering is not stored anywhere but calculated from the tree position of each element. Basically you can refer to Package.Elements for the main number (in the order they appear; the  Sort Features Alphabetically option might be a problem) and Element.Elements for (recursive) sub-numbers.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Element Level Numbering Location
« Reply #5 on: June 28, 2016, 08:48:43 pm »
Hi Dan,


The tree position is stored in t_object.TPos, or read from Element.TreePos.

Please note that EA doesn't actually set these values until you manually reorder the elements. Once you move one element up or down, just once, EA then starts setting the TPos values in that package. This is true in 11.1 and has been for a long time before, though I'm not sure if it's been addressed in later versions.

So until you do a manual reorder, it is just done in the app layer. Once you have done one, the information is stored in the database.

When it comes to document templates, there is actually an Element field called Level Number so you shouldn't need to create a fragment for it. Whether that works correcly without the manual reorder workaround I couldn't say, but it's worth a try.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Element Level Numbering Location
« Reply #6 on: June 28, 2016, 08:52:21 pm »
I should add that t_object.TPos contains only the position relative to the immediate parent, not relative to the package. So you'd need to work out the 1.2.3.4 form yourself.

/U
My theories are always correct, just apply them to the right reality.

krogarth

  • EA Novice
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Re: Element Level Numbering Location
« Reply #7 on: June 28, 2016, 09:46:29 pm »
Hi All

Thanks for the detailed replies!

Seems like I was trying to over complicate it by looking for a database field when Uffe highlighted the answer as being the simple 1, using the Element.LevelNumber in the template generator works  :)

I didn't even need to re-order the elements in the browser and the t_object.TPos is null but I get the correct level numbers, even with parent / child structure

Thanks for your help

Dan