Enterprise Architect - Import relations

1k views Asked by At

I have a model in Enterprise Architect and I need to import some relationships (of already existing elements) that I have in an Excel. I tried running a JScript but wasn't able to run it (haven't still figured out why).

How can I import a massive amount of relationship into my model?

Thanks in advance.


My Script is:

!INC Local Scripts.EAConstants-JScript

var connectorArray = new Array(
['{870632BA-154F-4564-AD51-C508C1A7E537}','{4B291196-7B4B-490b-B51D-04B9925CAA2A}','Dependency','','RME1']
);

function main()
{
 var source as EA.Element;
 var target as EA.Element;
 var connector as EA.Connector;
 var sourceGUID,targetGUID,type,stereotype,alias;
 for(var i = 0; i < connectorArray.length; i++) {
  sourceGUID = connectorArray[i][0];
  targetGUID = connectorArray[i][1];
  type = connectorArray[i][2];
  stereotype = connectorArray[i][3];
  alias = connectorArray[i][4];
  source = Repository.GetElementByGuid(sourceGUID);
  target = Repository.GetElementByGuid(targetGUID);
  Session.Output("Processing connector: " + alias);
  if(source != null && target != null) {
   connector = source.Connectors.AddNew("",type);
   if(stereotype != "") {
    connector.Stereotype = stereotype;
   }
   connector.SupplierID = target.ElementID;
   connector.Alias = alias;
   connector.Update();
  }
  source.Connectors.Refresh();
 }
 Session.Output("END OF SCRIPT");
}

main();


My errors are:

[423447640]      Hilo de registro de pila establecido para marcos 3
[423447879]      Default Directory is C:\Program Files (x86)\Sparx Systems\EA
[423447879]      Agent dll found: C:\Program Files (x86)\Sparx Systems\EA\vea\x86\SSScriptAgent32.DLL
[423447879]      Default Directory is C:\Program Files (x86)\Sparx Systems\EA
[423447879]      Agent: Started
[423447967]      Microsoft Process Debug Manager creation Failed: 0x80040154 
[423447967]      This is included as part of various Microsoft products.
[423447967]      Download the Microsoft Script Debugger to install it.
[423447967]      Failed to initialize JScript engine
[423447967]      SesiĆ³n de depuraciĆ³n terminada

Thanks again.

2

There are 2 answers

0
Grigorio On

Well, may be I'm wrong, but you can see the error Download the Microsoft Script Debugger to install it. I guess, that you're trying to run the script "Debug" button instead of "Run script".

If you want to debug your scrtipt, you"ll must to install any Microsoft product that contains debagger. Microsoft Script Debugger.

0
Dah Sra On

FYI Did you try the Excel Import \ Export feature of Sparx Systems in MDG Office Integration .

You can create \ update \ Synchronise model elements, connectors and other details inside enterprise architect in a single click.