Author Topic: element full name in script  (Read 3675 times)

deefer

  • EA User
  • **
  • Posts: 98
  • Karma: +0/-0
    • View Profile
element full name in script
« on: August 13, 2010, 07:01:54 pm »
Hi

is there a way to get the element full name (like in rtf generator) also in a script (VBScript)?

Many thanx
Davide.

beginner

  • Guest
Re: element full name in script
« Reply #1 on: August 13, 2010, 09:16:27 pm »
Parse upward with ParentID.

b.

deefer

  • EA User
  • **
  • Posts: 98
  • Karma: +0/-0
    • View Profile
Re: element full name in script
« Reply #2 on: August 13, 2010, 10:17:41 pm »
Thanx b.

I was wondering whether there was a ready solution but that's also quite easy.

D.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: element full name in script
« Reply #3 on: August 16, 2010, 03:40:16 pm »
Davide,

The solution suggested by b. is the most "correct" one, but if you have to do that a few thousands of times it might be a serious performance issue.
You can achieve more or less the same thing using Repository.SQLQuery.
The advantage is that this is a lot faster (as you only need one call to the db to get all levels iso one call per level).
The downside is that you can't use recursive queries and you'll have to guess the "maximum" levels you will ever need (640 ought to be enough for everybody ;))


Geert

deefer

  • EA User
  • **
  • Posts: 98
  • Karma: +0/-0
    • View Profile
Re: element full name in script
« Reply #4 on: August 16, 2010, 03:58:57 pm »
Thanx Geert
I'll consider that, but so far I have to perform the command only few times on the whole project so it is ok like it  is...
D.