Book a Demo

Author Topic: Using ExportPackageXMI  (Read 7015 times)

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Using ExportPackageXMI
« on: August 27, 2009, 01:21:40 am »
Hi,

I'm very new to EA and am trying to create an AddIn and use the ExportPackageXMI method.

I've managed to wander my way through GetProjectInterface, PackageGUID's and so on (through more luck than judgement sometimes  ;) ) and have set the parameters for the method to what I need.  

However, is there a way to turn off the 'Write Log File' check box?

Also, I'm finding it quite hard to figure out the complete Object model.  :-/ Is there something that may have hyperlinks to the various objects, methods etc? Does something like that exist? (Apart from the Help file/Model entry  ::) ) Perhaps I need something that will describe how the whole project sits together.

TIA
Martin

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Using ExportPackageXMI
« Reply #1 on: August 27, 2009, 08:13:58 am »
Hi Martin,

ExportPackageXMI does not currently have a parameter to turn off writing the log file. As far as I'm aware it should use the last set value when you used the dialog through the UI - so if you uncheck that and do an export it should be unchecked for future exports. If you'd like to see this option added, please feel free to log a feature request.

The project interface also contains a few methods to enumerate over the object model without loading the objects in question. For more information, consult http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/project_2.html, in particular all the methods that start with the word Enum.
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Using ExportPackageXMI
« Reply #2 on: September 01, 2009, 06:46:02 pm »
Hi Michael,

Many thanks for the reply. It would appear that check box gets set regardless of how it is set manually. It's not a major issue, just thought it would be nice not to create unnecessary files. :)

In terms of the object model, I'll look up that link.

Thanks again for your help.

Regards
Martin

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Using ExportPackageXMI
« Reply #3 on: September 01, 2009, 09:26:46 pm »
Martin,

A lot of settings that get 'remembered' by EA are stored in the registry. This includes not just (many of) those on the Tools | Options dialog but other settings elsewhere, including the XMI settings.

In several other situations EA treats these global settings differently in the API than the UI. For example, when you create a new diagram in the UI EA respects the defaults (for example, whether to show diagram notes). If you create a diagram from the API EA uses a 'standard' setting for each option; you have to explicitly change these if you want something else. These 'standard' settings are hard-wired into EA. [NB: This particular example might be out of date. It looks like the most recent builds of EA might respect this setting. However, the described behavior holds true in many other places.]

Unfortunately, some of these settings are difficult or impossible to affect affect (or even access) from the API. Some might see these cases as 'missing' features; IMHO these are bugs. I encourage you to submit a request or report, depending on your viewpoint, directly to Sparx. Use one of the links below the Support link near the bottom of any forum page.

David
No, you can't have it!

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Using ExportPackageXMI
« Reply #4 on: September 01, 2009, 09:45:04 pm »
Hi David,

Thanks for the comments. Although I'm new to EA, I'm certainly not new to using APIs etc and would agree that properties missed from the API interface should be viewed as missing features. I'll fill out a request form accordingly.

Martin

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Using ExportPackageXMI
« Reply #5 on: September 02, 2009, 06:54:50 am »
Great Martin,

As to being new to EA, we all had to start sometime...

If you have any experience with COM programming, or using ActiveX components, then you should be fine with EA. Note that you have to get used to (read "learn to accept") the way EA does things. Don't fight it, just work with it. Once you clear that hump it works pretty well.

David
No, you can't have it!

JanosK

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Using ExportPackageXMI
« Reply #6 on: September 11, 2009, 08:03:34 pm »
Hello,

do you guys know of any possibilities to not let the EA's "Export Package to XMI" dialog appear, when programmatically performing the export? We would like to perform the export in the background, but the whole process seems to be tightly joint to the dialog.

For the record:
The checkbox "Exclude EA Tagged Values" doesn't seem to be modifiable by the API. Indeed this option is an important setting to achieve UML2, which can be "understood" by the Eclipse EMF.

Cheers
Janos

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Using ExportPackageXMI
« Reply #7 on: September 11, 2009, 08:37:36 pm »
Hi Janos,

It may be possible via Windows API to hide the dialog box. However. I don't think you'll gain anything, especially, as you say, the whole thing is tightly tied to the actual app.

I would think that EA is busy with extensive resource utilisation while it's doing the export and wouldn't want you to be able to do anything else - hence why the dialog window is 'modal'.

As for the checkbox(es) that don't appear to be set via the API, I've already, as suggested by David earlier in this thread, raised a feature request.

Martin

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Using ExportPackageXMI
« Reply #8 on: September 11, 2009, 08:42:38 pm »
IMHO the fact that the dialog appears when this API function is called is a bug. I suggest you issue a bug report using the Report a Bug link near the bottom of any forum page.
No, you can't have it!

JanosK

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Using ExportPackageXMI
« Reply #9 on: September 11, 2009, 11:18:07 pm »
Thank you guys,
i've submitted a bug report on the export dialog issue.
Cheers