Author Topic: Importing relations between objects  (Read 4850 times)

Albert De La Fuente

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Importing relations between objects
« on: April 25, 2012, 02:04:31 pm »
Hi,

I have a huge requirements list in excel that I'm able to import (csv) fine on EA. For each requirement, I want to create an use case, so I transform the file by changint the object type and I'm able to import (csv) it fine too.

Now what I would like is to import a single (1x1) relation between each use case and each requirement. UC01 <-> REQ01, UC02 <-> REQ02, and so on.

I have not found any "Realisation" object type or similar on the csv file so that it can be imported automatically. Is there any way to do this?

So what I thought is... Export (csv) both the use cases and the requirements with full UUID's to separated files, and them relate the UUID's of each in a new file that later will be processed by a python script to generate a xmi file so it can be re-imported to EA.

This approach is not very easy, so I'm looking for something more simple, if possible via csv.

Any ideas?

Thanks a lot!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Importing relations between objects
« Reply #1 on: April 25, 2012, 09:32:53 pm »
See Simple VBA Excel EA importer
Should be easy enough to include a feature to import relationships.

Geert
« Last Edit: April 25, 2012, 09:33:28 pm by Geert.Bellekens »

Albert De La Fuente

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Importing relations between objects
« Reply #2 on: April 25, 2012, 10:27:32 pm »
Thanks for your answer Geert,

I downloaded the xls file and open up the macro definitions, but I'm not able to execute it, I get the following error on EA.repository: “Can't find Project or Library”. I'm using EA & excel through wine emulation on linux

Is there something similar in Java? (i.e. Java cvs classes importer). At this point what I would like to know is how to import a relation between two or more objects, could you please highlight me where is that on your code? (line number)

Thanks again!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Importing relations between objects
« Reply #3 on: April 25, 2012, 10:34:21 pm »
I don't know of any existing java code that does the same, but I don't see why it shouldn't be possible.
The reason you're getting the error is probably because it can't find the Interop.EA.dll

The excel only imports classes and attributes, but adding a function to handle relation should be quite easy.

Geert

Albert De La Fuente

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Importing relations between objects
« Reply #4 on: April 25, 2012, 10:44:54 pm »
Thanks Geert,

I will research more about the dll to make it work.

Do you know what would be the routine to invoke to import a "Realisation" (or other) relationship?

Thanks again!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Importing relations between objects
« Reply #5 on: April 25, 2012, 10:50:13 pm »
Should be similar to:
Code: [Select]
EA.Connector newConnector = Element.Connectors.AddNew("""Realization");
newConnector.SupplierID = myTargetID;
newConnector.Update();

Geert







Albert De La Fuente

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Importing relations between objects
« Reply #6 on: April 25, 2012, 11:00:07 pm »
Thanks a lot Geert,

I will try that!