Book a Demo

Author Topic: Creating/importing relationships  (Read 4874 times)

andykennelly

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Creating/importing relationships
« on: March 06, 2013, 09:57:07 pm »
My organisation has services which call other services (e.g. high level service 'getCustomer' calls low level services 'retrieveCustomerId' and 'retrieveCustomerDetails').

I want to populate EA with all these services to make them available subsequently to various specific models/diagramatic representations etc. I also want to create the dependency links between the high and low level services (for impact analysis purposes etc.).

Now, I can easily do a CSV import of all the services (which I'm choosing to represent as component elements). I could then, of course, manually create the dependencies (drag and drop onto a diagram and put the dependency arrow between the relevant components). However, we've got many dozens (potentially hundreds) of these so I'm wondering if there's a way of doing this as a one-off. The only way I can think of doing it is to do some whizzy file processing and create an XMI file to import, e.g. populate a file with the components and their relationships and write something to create XMI in the same format as what you'd get if you'd done all this manually and exported to XMI. This could be quite a complex piece of code and I'm not sure of the impact of generating ,wtihin that code, internal XMI identifiers.

Has anybody been faced with the same challenge?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Creating/importing relationships
« Reply #1 on: March 06, 2013, 10:27:45 pm »
There is no other way than scripting this. While an import via csv can easily create elements the relations are more difficult. So you can't do that via csv. For that reason there's no standard import. However, a script is simple. You can still use a csv format but you have to think of a way to identify the elements in EA (most likely by a unique name) so you can create the relation. The best is to start off with the sample script that comes along with EA to import a simple csv.

q.
« Last Edit: March 06, 2013, 10:29:12 pm by qwerty »

Robert Sheridan

  • EA User
  • **
  • Posts: 105
  • Karma: +0/-0
    • View Profile
Re: Creating/importing relationships
« Reply #2 on: March 06, 2013, 10:43:56 pm »
I successfully imported a matrix spreadsheet containing a list of functions (grouped under higher level functions) cross referenced to a list of services (grouped by regions) using the automation interface.  I used Geert's spreadsheet from the community forum to get me started.

The automation interface enable me to create package hierarchies to group the the services and functions as well as create elements for the actual services and functions.  I created the services first and then as I created each function I parsed the spreadsheet to see which services it was associated with and created a dependency relationship.

andykennelly

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Creating/importing relationships
« Reply #3 on: March 12, 2013, 03:15:39 am »
Robert -

I'm also using geert's spreadsheet to get me started, but I'm struggling with adding a dependency relationship. Using eaConn, I can only see the following:-
- addOrUpdateAttribute
- addOrUpdateAttributeTag
- addOrUpdateClass.

Any guidance woud be appreciated.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Creating/importing relationships
« Reply #4 on: March 12, 2013, 06:01:31 am »
You need to do something like
Code: [Select]
con = EaElement.Connectors.AddNew("name", "Association");
con.SupplierID = supplier.ElementID;
con.Update();

q.