Dependency mapping from spreadsheet

581 views
Skip to first unread message

Octavian

unread,
Apr 17, 2012, 1:24:00 PM4/17/12
to sparx-enterprise-archite...@googlegroups.com
Hello all! I was hoping you could help me with a situation:

1. I have an excel table with 5 columns and about 200 rows. The columns are as follows:
A = Component 1
B = Type of Interface
C = Component 2
D = Interface name
E = A note
F = Output

2. I have to create a dependency diagram using any tool - but I want to do it in EA since it's easier to maintain later.
3. I want to include all columns but the last two can be omitted if necessary.

Any ideas? Can I import these somehow and have the lines "draw themselves"? Last thing I want to do is do this whole thing manually.  :'(

Cheers,
Octavian

[original message]

qwerty

unread,
Apr 17, 2012, 2:29:00 PM4/17/12
to sparx-enterprise-archite...@googlegroups.com
You can do this 'quite eaily' using EA's API. Have a look at the scripting view. It's a little effort but pays off for later.

q.

[original message]

Octavian

unread,
Apr 17, 2012, 2:30:00 PM4/17/12
to sparx-enterprise-archite...@googlegroups.com
Interesting. Any specific section in EA's API? Right now I'm trying to import via CSV...
[original message]

qwerty

unread,
Apr 17, 2012, 2:59:00 PM4/17/12
to sparx-enterprise-archite...@googlegroups.com
I'm afraid CSV import will not be able to create the references. What you need to to is in short:

Code:
pk = repos.GetTreeSelecetdObject() # highlighted package in browser
for each row
�c1 = pk.Elements.Addnew (col1, "Component")
�# you might have a local lookup for duplicates
�c1.Update
�c2 = pk.Elements.Addnew (col3, "Component")
�c2.Update
�# now I don't know how you will handle your interfaces but to make it simple
�con = c1.Connetors.Addnew("", "Association")
�con.clientId = c2.ElementId
�con.update() # link c1-c2 via association
end

Hope that gives an idea. There are quite some example scripts you can take as a start (VB and JScript).

q.

[original message]

Octavian

unread,
Apr 17, 2012, 3:28:00 PM4/17/12
to sparx-enterprise-archite...@googlegroups.com
OK. I can definitely understand the code but I'd need a primer on how to use the API. Never done it before. I'll do some searches.

Any alternatives?

[original message]

qwerty

unread,
Apr 17, 2012, 4:20:00 PM4/17/12
to sparx-enterprise-archite...@googlegroups.com
Until someone else comes up with a better solution (CSV import might have improved since I last used it) you should look into View/Scripting. The samples are a good start.

q.

[original message]

Sunshine

unread,
Apr 17, 2012, 11:06:00 PM4/17/12
to sparx-enterprise-archite...@googlegroups.com
The old problem of should I manually do it or spend some time automating it aye?

To help you work out what its going to look like I suggest you model one example so you understand how your model will look. For instance there are two ways you can model an interface. One attached to a component and the other is as a separate object.

If you have VBScript or JScript skills then suggest writing a script that parses your CSV file and creates the components, interfaces etc.
There are plenty of example scripts and you'll have to search the forum for examples on creating relationships

Once your script has successfully imported the components, interfaces and relationships then you can drag the components onto a diagram to draw up. Alternatively in your script you can make your script a bit more complex and create diagrams too.

Think this would probably take me around half a day to write, test and fix any bugs. So assuming you could do it in the same time the question is would it be quicker doing it manually? I would be tempted to resort to doing it manually if it was a one off job and there 100 or less entries in that original files. If on the other hand your going to do this more than once then definitely go down the automation process.

Well hope that helps.

[original message]

Bellekens@localhost Geert Bellekens

unread,
Apr 18, 2012, 1:28:00 AM4/18/12
to sparx-enterprise-archite...@googlegroups.com
You could also have a look at the simple vba excel importer (http://community.sparxsystems.com/resources/scripts/simple-vba-excel-ea-importer) I uploaded on the community site.
That should give you a jump start as it already reads an excel file and creates and/or updates stuff in EA.

Geert

[original message]

Octavian

unread,
Apr 18, 2012, 9:40:00 AM4/18/12
to sparx-enterprise-archite...@googlegroups.com
Thank you sir! I will give it a try. Lovin the support! Cheers!
[original message]
Reply all
Reply to author
Forward
0 new messages