Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jim Lawrence

Pages: [1]
1
After turning in a bug report on this, it turns out that EA has a "feature" that I had to overcome.  It turns out that in my testing/investigations I had clicked on the enable/disable checkbox for our MDG tech.  It seems that if the user "EVER" enables/disables the MDG tech in the "Settings>MDG Technologies ..." dialog, it adds a techid enable/disable string to the registry at (may vary with your version): HKCU\Software\Sparx Systems\EA400\EA\OPTIONS\MDG_TECHNOLOGY_STATUS
The string is of format: techID=0|1;
This value in the registry will forever more rule the enable/disable capability of your tech.  There is no way for a user to get rid of this string without editing the registry (not something we want a user to mess with).  As we want to make our UML profile and MDG tech the default on startup, I added code to the event handlers to search for and remove the enable/disable string during startup/shutdown.  It doesn't prevent the user from disabling our tech, but is does insure that the next time EA starts, our tech is enabled and made the default tech.

To make your tech the default, write to the same OPTIONS key above, but set key (may vary with your version) MY_TECHNOLOGY to the value of your techid

2
After returning our the xml from our MDG file in an EA_OnInitializeTechnologies event handler, EA does not enable the MDG tech (i.e. the Enabled checkbox is not checked), but the documentation says EA will load and enable it.

I thought there might be a problem with our file, so I copied the SimpleUI.xml file (from EA installation), changed the name and ID and loaded it in our EA_OnInitilizeTechnologies event handler.  I got the same results.  The loaded tech was NOT enabled.  It appears that any MDG tech loaded via addin DLL is never enabled.

Code: [Select]
  public string EA_OnInitializeTechnologies(EA.Repository repository) {
      //string filename = @"C:\Users\<username>\AppData\Roaming\STOMP\stomp.xml";
      string filename = @"C:\Users\<username>\Documents\Visual Studio 2010\Projects\STOMP\xml\stompJL.xml";
      string xml = null;

      if (debug) MessageBox.Show("EA_OnInitializeTechnologies");

      // get the profile data
      xml = File.ReadAllText(filename);

      // return profile data so EA can import it
      return xml;
    }

Any suggestions on how to get EA to enable MDG tech files?

I was expecting an EA_OnPostInitialize event at some point after loading my eap file, but it never occurs.  I thought I might be able to activate my MDG tech here but EA never issues the event.

What are the order of EA events at startup/shutdown?  Where are these documented?  I've been able to determine a few by displaying message boxes in the event handlers.

3
Thanks for answering #2

As regards #1, I noticed the reference page for EA_OnInitializeTechnologies states:

"EA_OnInitializeTechnologies requests that an Add-In pass an MDG Technology to Enterprise Architect for loading.

This event occurs on Enterprise Architect startup. Return your technology XML to this function and Enterprise Architect loads [highlight]and enables[/highlight] it."

However, when I return the xml in the event handler, my technology is NOT enabled (i.e. when I check the "Setting > MDG Technologies .." window, the Enabled box is NOT checked).

Is the documentation in error or the EA code? or could my tech xml be causing an error (although, no errors are reported once loading is completed)?  My profile seems to be working fine once I manually enable and activate it.  I looked for a bug report on this but didn't see one.

What events occur after "EA_OnInitializeTechnologies" that I can use to activate my profile during EA startup?  I'm still looking to "activate" my tech without the user having to do it manually.

Thanks

4
I've got a UML profile we've developed and want to load it, enable it and activate it programatically.  I've got it loaded (it shows up in "Settings>MDG Technologies"), but haven't been able to find a way to enable or activate it.  So ...

1) how is a MDG technology enabled programmatically?

2) how do I get the "ID" that IsTechnologyEnabled and IsTechnologyLoaded require (I tried the MDG Tech name but that didn't work)?

ActivateTechnology might work if it accepts the MDG Tech name or I can get the "ID".

Thanks

Pages: [1]