Book a Demo

Author Topic: How to import in Enterprise Architect with relatio  (Read 7729 times)

user_368285

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
How to import in Enterprise Architect with relatio
« on: March 13, 2015, 04:24:43 am »
How to import in Enterprise Architect with specifying relationship customizing JScript?

I need import requirements from .csv file iin Enterprise Architect, with specifying Relationship among requirements. I know that is not possible do it with pre configured import tool. However I know is possible modifies the JScript-CSV. Anyone knows how modifies this script in order to import requirements from .csv with relationships?

Thanks in advance.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to import in Enterprise Architect with rel
« Reply #1 on: March 14, 2015, 03:39:09 am »
Basically what you need to do is to add some unique identifier to the CSV which is used in the relations.

id;req name;related to #

Then you create the elements in a first run. And in the 2nd run you look at the related to # and create a <<trace>> or whatever relation.

q.
« Last Edit: March 14, 2015, 03:39:26 am by qwerty »

user_368285

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: How to import in Enterprise Architect with rel
« Reply #2 on: March 16, 2015, 09:17:55 pm »
Hi qwerty, thank you for your response and for the time time your spent to help me.

Have you any suggestions for modify jscript-csv?
I don't know this script, I only seen some line of code, and I have not found no sdescription line that explain how to manipulate a link (trace, or other).

Can you help me, providing me some example?

Thank you

Sam Courtney

  • EA User
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: How to import in Enterprise Architect with rel
« Reply #3 on: March 16, 2015, 11:00:29 pm »
We have built a platform to import content with relationships into EA using a CSV format. See this link for more details:
http://www.aprocessgroup.com/products/apg-modelflow/
If you would more details, plz send a PM and I'll be glad to help you.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to import in Enterprise Architect with rel
« Reply #4 on: March 17, 2015, 01:07:03 am »
Creating a connector is fairly easy. Once you got the two requirements elements in according objects (say source and target) you create the connector like this:

Code: [Select]
connector = source.Connectors.AddNew( "", "Dependency" );
connector.SupplierID = target.ElementID;
connector.Update();

q.

user_368285

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: How to import in Enterprise Architect with rel
« Reply #5 on: March 17, 2015, 10:13:51 pm »
Quote
Creating a connector is fairly easy. Once you got the two requirements elements in according objects (say source and target) you create the connector like this:

Code: [Select]
connector = source.Connectors.AddNew( "", "Dependency" );
connector.SupplierID = target.ElementID;
connector.Update();

q.

Hi qwerty,
I think you are very big expert in Enterprise architect!
Unfortunately, I'm newer  in EA, and I have some doubts for it use.

I thought it was possible modify the script Jscript-csv (from application bar Tools/Scripting/EAScriptLib) and run the CSV import command to use my modifies. Wrong thought!

Furthermore the Jscript-csv has no effect, when I run it.
The console output of the script is the following:

[01632329]      Stack recording threshold set to 3 frames
[01632426]      Default Directory is C:\Program Files (x86)\Sparx Systems\EA
[01632427]      Agent dll found: C:\Program Files (x86)\Sparx Systems\EA\vea\x86\SSScriptAgent32.DLL
[01632427]      Default Directory is C:\Program Files (x86)\Sparx Systems\EA
[01632428]      Agent: Started
[01632651]      edit and continue - unsupported
[01632723]      Script finished
[01632724]      Debug Session Ended

Have you any suggestions to clarify me how use the script?

Tahnk you in advance!



Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to import in Enterprise Architect with rel
« Reply #6 on: March 17, 2015, 10:29:06 pm »
It says it right there in the comments:
Quote
* CSV Import can be performed by calling the function CSVIImportFile(). CSVIImportFile() requires
 * that the function OnRowImported() be defined in the user's script to be used as a callback
 * whenever row data is read from the CSV file. The user defined OnRowImported() can query for
 * information about the current row through the functions CSVIContainsColumn(),
 * CSVIGetColumnValueByName() and CSVIGetColumnValueByNumber().

Geert