Book a Demo

Author Topic: Can you import a CSV file as a relationship matrix?  (Read 4898 times)

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Can you import a CSV file as a relationship matrix?
« on: November 19, 2020, 06:55:07 pm »
I have a CSV file which has class names as the rows and columns and indicating with a "1" if there is a dependency. Can I import this information into EA somehow and get a relationship matrix?

horszasz

  • EA User
  • **
  • Posts: 22
  • Karma: +6/-0
  • My name is Gergely :)
    • View Profile
Re: Can you import a CSV file as a relationship matrix?
« Reply #1 on: November 19, 2020, 09:24:13 pm »
Hi mse,

No, it is definitly not possible.

The relationship matrix is about showing the existing connections between model objects, extended with some create/modify capabilities. It is a "real time" feature: it shows always the current state of the model, and whenever you save the matrix, you save just the definition of it, not including it's content or picure.

So importing data from any external source, and showing them in the form of a relationship matrix is not possible, and it does make no sense.

Hope, I could help.

Regards,
Gergely

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Can you import a CSV file as a relationship matrix?
« Reply #2 on: November 20, 2020, 06:56:32 am »

Whilst its not possible with off-the-shelf features available in Sparx it is impossible if you can code in C# or JavaScript.

First of all if the matrix is not too big then you probably best just doing in manually in Sparx EA. Which is what you should have done in the first place.
However to help accelerated the effort and save typing in all the class names again  from scratch you could do the following.
  • Create a CSV Export with GUID, Type and Name fields
  • Create one package and a class in sparx EA.
  • Use the CSV template to export the package with the class you created
  • Copy the class names from your matrix csv and paste all the class names into the Name Column of the export CSV file.
  • Copy and paste the Object Type down to match each class name into the CSV file and save.
  • Now import that CSV file with all the new classes added.
That should at least create all the classes as a starter for 10. Now just open a matrix in Sparx EA and manually create the relationships.
 

However, if you really need to an import into Sparx EA using matrix CSV file as you are going to be doing it a lot or there is a lot of data then you could write a JavaScript or C# Plugin that parses the CSV file and creates the classes and relationships. It would probably take a few days of effort for a developer.


You'll probably be able to figure out if the manual entry approach is less effort than the automated approach and take the option which is least effort.
Happy to help
:)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Can you import a CSV file as a relationship matrix?
« Reply #3 on: November 20, 2020, 08:24:00 am »

Whilst its not possible with off-the-shelf features available in Sparx it is impossible if you can code in C# or JavaScript.
Double impossibilities: Anything goes (Cole Porter)
Funny enough, one of the song titles is Let’s Misbehave. Guess who.

q.
« Last Edit: November 20, 2020, 08:27:46 am by qwerty »

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: Can you import a CSV file as a relationship matrix?
« Reply #4 on: November 20, 2020, 06:53:36 pm »
Steps 1 through 6 were already done since this is porting an existing model created in another tool into EA. The dependencies were created from the beginning, but in the other tool.

I will just go with the manual method of importing the dependencies as suggested. it will take far less time than scripting it because our original excel sheet containing that information (also derived from that original model) looks exactly like a relationship matrix. All I have to do is open the matrix and the excel side by side and right-click, add dependency, and so on.

Thanks for the replies everyone  :)