Book a Demo

Author Topic: csv file import in EA version 9.0.906  (Read 3481 times)

radorno

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
csv file import in EA version 9.0.906
« on: June 06, 2012, 12:19:46 am »
Hi!

I start using EA a couple of weeks ago, so I still learning it.  Hopefully someone here could help with this, I need to import a serie of csv requirements files which have 10 element fields.

Ok, I already configured the "CSV Import/Export Specification", where I selected the applicable element fields from the available list.  Now, this version of EA (9.0.906) does not provides the option to include "added Tagged Value Fields" from the "CSV Import/Export Specification" as recent versions do.  My files have two columns that are specific for the project I'm working on, in other words "added Tagged Value Fields".

Since this version of EA does not provides this feature and upgrading to a recent version is not an option (for now), what options do I have to import my files correctly?  I'm not sure if modifying the script "JScript-CSV" could help me as I tried without success.

Please help!!!!!! :-[

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: csv file import in EA version 9.0.906
« Reply #1 on: June 06, 2012, 02:46:40 am »
You can import this fields into another unused element property (for example "Alias", "Phase" or "Keywords") and, after the import process, move this values to Tagged Values using a script.

The VBScript to move should be something like this:

dim MyPackage as EA.Package
dim MyElement as EA.Element
dim MyTag as EA.TaggedValue
dim i

set MyPackage = Repository.GetTreeSelectedPackage()
for i = 0 to MyPackage.Elements.Count - 1
     set MyElement = MyPackage.Elements.GetAt(i)
     set MyTag = MyElement.TaggedValues.AddNew("Tag Name", MyElement.Alias)
     MyElement.TaggedValues.Refresh()
     MyElement.Alias = ""
     MyElement.Update()
next


Note: code not tested. Any compilation without errors is purely coincidental  ;)
« Last Edit: June 06, 2012, 02:55:42 am by Deiser »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: csv file import in EA version 9.0.906
« Reply #2 on: June 06, 2012, 05:13:28 pm »
You can check out my VBA el EA Importer
This tool was created to import classes and attributes, but it can easily be adapted to import requirements.
The operations needed to add tagged values are already there, you just need adjust to your needs.

Geert