Book a Demo

Author Topic: Export a EAP project to an XML file  (Read 5852 times)

Priyajeet

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Export a EAP project to an XML file
« on: August 15, 2006, 08:21:10 pm »
Now I know one can export an EAP project to an XMI file, which is XML itself. However I do not want that. I want the UML model in a standard/simple XML format of my choice. It can be lossy, since I wont be going the other way around. That is, wont be importing.

Now I was looking at the help documnet - section talking about The Project Interface (XML) under automation interface. That section does give only 1 example of connection to the interface in C#. The XML part, all the tutorial is in some old VB.

Is this possible in C# (VS 2005)? Any insight on how to go about exporting an EAP project file to a XML format of my choice using C#?

Thanks.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Export a EAP project to an XML file
« Reply #1 on: August 15, 2006, 10:09:46 pm »
Hi Priyajeet,

Since I needed to output to a predefined XSD specification and convert internal EA values to predefined ones, I just used the normal automation mechanisms and wrote the file directly.  I didn't use this mechanism.

BTW: Where is the C# example you mentioned?

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Priyajeet

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Export a EAP project to an XML file
« Reply #2 on: August 15, 2006, 10:14:13 pm »
Hi, thanks for the reply.
Can you be a bit more clear as to what you did? Thanks.

BTW, this was the only C# code in the help file for just connecting to the automation interface.
http://www.sparxsystems.com.au/EAUserGuide/setup.htm

thomaskilian

  • Guest
Re: Export a EAP project to an XML file
« Reply #3 on: August 15, 2006, 11:28:51 pm »
Simply parse the model recursively and 'print' the XML lines to the destination file.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Export a EAP project to an XML file
« Reply #4 on: August 15, 2006, 11:34:04 pm »
Quote
Hi, thanks for the reply.
Can you be a bit more clear as to what you did? Thanks.
Sorry, I can't be more specific than the following since I'm not writing a book on how to do it in C#, but...

I didn't find it that hard to translate the VB examples to C#

Start with the C# example from the Web Site.

If you have specific questions, I or someone else can try to answer them.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Priyajeet

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Export a EAP project to an XML file
« Reply #5 on: August 15, 2006, 11:35:17 pm »
thanks, I have already got some very basic stuff running. I ll ask for help as needed. thanks.