Author Topic: Validating Class Model Element Names from Uploaded .csv  (Read 4208 times)

TheVampyre

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Validating Class Model Element Names from Uploaded .csv
« on: April 26, 2018, 08:33:15 pm »
Hi All,

Bit of a noob to EA here.

What I'm looking to do is run a lookup against elements in my class models, from an imported list of names. This is due to spelling errors and trailing space issues creeping in during the current process. This will ultimately help me with our quality assurance.

I did try to raise this on StackedOverflow, but I got some angry child telling me just to do some programming with know real instructions or help.

Any help would be greatly appreciated.

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: Validating Class Model Element Names from Uploaded .csv
« Reply #1 on: April 26, 2018, 10:19:26 pm »
Hi D,

A model in Enterprise Architect is stored in a database, and that can be very useful sometimes. It means you can query it using plain old SQL.

In your case you could use something like

Code: [Select]
select o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.Name  as ObjectName
from t_object o
where o.Name in (
'firstname'
,'secondName'
)

If you go to model search, go into edit mode and paste this sql code in the SQL Scratch Pad, you should see some results (if 'firstname' or 'secondName' actually exist in the model as elements.)

Geert


TheVampyre

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Validating Class Model Element Names from Uploaded .csv
« Reply #2 on: May 01, 2018, 07:37:08 pm »
Hi Geert, thanks for that.

So where I can see 'Firstname' etc, can I replace these with entries from a .csv file ? then just check the lot?

Many thanks

D

Nabil

  • EA User
  • **
  • Posts: 147
  • Karma: +5/-2
    • View Profile
    • View My LinkedIn Profile Here
Re: Validating Class Model Element Names from Uploaded .csv
« Reply #3 on: May 01, 2018, 08:31:42 pm »
You can do this using a simple script Refer Sample Scripts In Menu Code|Scripting|Local scripts But not from .csv file

BR
Nabil
« Last Edit: May 01, 2018, 08:33:20 pm by Nabil »
Nabil

TheVampyre

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Validating Class Model Element Names from Uploaded .csv
« Reply #4 on: May 02, 2018, 06:24:50 pm »
Hi Nabil

see the thing is, I'm trying to avoid manually typing them in, so I don't get any errors and want to upload them from a source. Is there a good way to do this ?

As I say, I'm quite new to this, so as much help as possible needed.

Nabil

  • EA User
  • **
  • Posts: 147
  • Karma: +5/-2
    • View Profile
    • View My LinkedIn Profile Here
Re: Validating Class Model Element Names from Uploaded .csv
« Reply #5 on: May 02, 2018, 07:01:10 pm »
If you have an ultimate license you can try MDG Office you can export exiting info from EA along with GUIDs do a lookup and import again to Sync.

Also try CSV importer. Again Same Export(ALONG WITH guid) and Import TO SYNC(Replace names)

BR
Nabil
Nabil

TheVampyre

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Validating Class Model Element Names from Uploaded .csv
« Reply #6 on: May 03, 2018, 11:19:56 pm »
Hi Nabil,

Thanks for that, i'll try those to avenues and come back to you. Sounds logical at the moment and yes, I have the ultimate license.

Many thanks

D