Book a Demo

Author Topic: running EAAddin externally from c# Code  (Read 3663 times)

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
running EAAddin externally from c# Code
« on: June 08, 2011, 10:11:59 pm »
Hi all
i have a very uncommon problem.
I have written an Addin which works very well.
i have the possibility to export data from the .EAP and reImport it.
(not the EA built in export and import mechanism, i use my own)

now i have a new program which should do my exports and imports via commandline arguments with EA not beeing started.
I added the DLL of my Addin and the Interop.EA.DLL as References to my new program.
I can load .eap files programmatically and run my export and import methods.
But here starts the problem, especially with the import.
For some reason the method executed by the c# code throws exceptions where the method executed in the EA Gui does not.
For instance the creation of a new class
Code: [Select]
EA.Element newClass = (EA.Element)container.Elements.AddNew(className, "EClass");
throws an "invalid type" exception.
EClass is a class from a new created uml profile, stored in my Addin.
it looks like that EA does not know uml profiles if its started by code without the gui?

//EDIT

I stepped over the (hopefully) solution
it seems that EA_OnInitializeTechnologies(EA.Repository Repository) method is not executed if EA is started externly so my mdg technology is unknown for EA.
Now i need a way to "inject" the technology file within my program.
Somenone knows how to do that?
« Last Edit: June 08, 2011, 10:31:33 pm by stao »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: running EAAddin externally from c# Code
« Reply #1 on: June 09, 2011, 08:58:26 am »
Add-Ins are not loaded when EA is started from automation. I would recommend deploying your technology as a file.

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: running EAAddin externally from c# Code
« Reply #2 on: June 09, 2011, 06:16:10 pm »
thanks for the reply.
and when i have the file?
what can i do to inject the mdg technology?