Book a Demo

Author Topic: CSV Import & Preserve Hierarchy  (Read 6455 times)

JVatSparx

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
CSV Import & Preserve Hierarchy
« on: June 07, 2016, 12:44:43 am »
We just started with using EA for requirements and we thought using the following structure to collect the requirements for a Request for Change (RFC):
RFC Some question (Package)
   |_ Requirements (Package)
       |_ Req 1 (Requirement)
       |_ Req 2 (Requirement)

Since we use an MS-SQL database to store everything we use an Excel sheet to communicate about the requirements with clients. Because they do not have access to our EA environment.
Therefore we hoped to use the following method:
1. Export the Requirements only to a CSV file including the EA GUID
2. Import these Requirements into a formatted Excel including the EA GUID (using a macro)
3. Make any change we want to the requirement, leaving the EA GUID as is
4. Export the Requirements from Excel to a CSV file (using a macro)
5. Import the Requirements in EA

What I found is that works fine as long as I select the Requirement Package in EA before I import the CSV file. In this case the Requirements get updated within this folder.
However, if I select "Import CSV" from the "RFC Some question" (Package) or if there are Packages below the "Requirements" (Package). The Requirements are updated AND MOVED to the folder I selected when importing them.

By using the option "Preserve Hierarchy" EA exports two extra fields "CSV_KEY" and "CSV_PARENT_KEY". But the last, "CSV_PARENT_KEY", is only filled if also the "Requirements" (Package) that holds the Requirements is exported. This makes it almost impossible to use a nicely formatted Excel sheet for our clients because this information has to be preserved in the CSV file for later import.

My question is:
Why does EA need these extra fields to preserve the hierarchy?
EA can detect the parent of the Requirement (object), based on the GUID.
So why can't this be used when "Preserve Hierarchy" is chosen?


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 Import & Preserve Hierarchy
« Reply #1 on: June 08, 2016, 05:00:15 pm »
have you thought about hiding the columns in excel?

Geert

JVatSparx

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: CSV Import & Preserve Hierarchy
« Reply #2 on: June 13, 2016, 11:03:04 pm »
Yes of course I can hide this information in Excel. But that's not the point.
The way this now works in EA depends on the level from where you export the objects and where you start the import again. If these are not the same the hierarchy is not preserved.
If I have within a project package a Requirements package with 5 sub-package with the requirements and I want to export all requirements to a CSV/Excel file. I can select the Requirements package and export all requirements and packages with "Preserve hierarchy". I then get a csv file with these objects and as last to columns both keys.
However, if I then after made some changes in Excel I regenerate the CSV file (with sub-packages and keys) and I choose in EA the Project package for importing, I get 5 'new' sub-packages below the Project package and all th requirements are now in these new sub-packages.

While if EA would use the GUID to preserve the hierarchy this wouldn't happen

Rodrigo Nunes

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: CSV Import & Preserve Hierarchy
« Reply #3 on: April 02, 2018, 11:30:04 pm »
try using direct numbering in Excel.I did it once, erasing the numbering placed by EA and it worked. I used the CSV_PARENT_KEY and CSV_KEY columns with my self-enumeration