Book a Demo

Author Topic: XMI export to Eclipse/EMF  (Read 12037 times)

olafk

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
XMI export to Eclipse/EMF
« on: August 15, 2007, 04:33:03 pm »
Hi.

I have been trying to export my (quite simple) EA model to XMI and, subsequently, re-imported into the Eclipse/EMF environment. In other words, export from EA to an XMI file (containing the model in UML2.1/XMI2.1 shape and form), and import into Eclipse EMF.

I am using EA 7.0.814, and Eclipse 3.3 (with UML2 2.1.0).

Needless to say I have been unsuccessful (otherwise I wouldn't be posting ;-). With all sorts of import problems - ranging from unrecognized "features" to missing types for class attributes. Clearly, this is either due to EA exporting in non-compliant shape; or Eclipse being flawed; or, me doing something entirely stupid.

Can I ask if forum members have tried (and managed) such export / import / integration? Which versions of EA/UML/XMI  exactly? Any manual fix-ups (as I had partial success by manually doctoring the EA-exported XMI file...)

Has sparxsystems attempted such loads? How has compliance with UML2.1/XMI2.1 been verified / tested?

Other thoughts / comments?

Cheers,
-olaf

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #1 on: August 15, 2007, 04:41:53 pm »
I haven't tried it myself, but I think the issue is that Eclipse EMF isn't expecting an EMF XMI file instead of a UML XMI file.  EA currently doesn't support exporting to this format.

So (if I remember correctly) it's not an issue with compliance to the XMI spec for either tool.  It's that EMF doesn't use UML as such.
« Last Edit: August 15, 2007, 04:42:50 pm by simonm »

olafk

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #2 on: August 15, 2007, 08:04:15 pm »
Hi Simon,

Hmm... I was afraid somebody'd say that... but correct me if I am wrong but isn't XMI "the" standard form to which UML models are serialized? In other words, isn't it the standard with which tools interchange their models (regardless of what their respective meta-models are - as long as they manage to marshal / unmarshal into such an XMI structure).

For instance, when I inspect a simple model comprising a class that has two attributes, I find EA generating an XMI that sticks the attributes' types into an "Extension" element (defining the class attribute as, seemingly, an EA "extension"). On the other hand, an (Eclipse) sample XMI file holds class attributes as sub-elements to the class itself.

Now, that kind of variation in "interpretation" of how UML elements are to be serialized (into what is presumably a _standard_) seems hard to explain...?!? Can it really be a matter of interpretation as to how a class attribute is to be represented in XMI. (I suppose, I should have a closer look at the actual XMI standard document for a definitive answer, right?)

(See also: http://dev.eclipse.org/newslists/news.eclipse.modeling.mdt.uml2/msg00688.html which discusses a similar issue...)

Any other thoughts?

And if we indeed assume that we're dealing with a "special" Eclipse form of UML/XMI, any discussions at Sparx to support such an export format? After all, EMF is shaping up as a major player in this arena...

ciao,
-olaf

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #3 on: August 15, 2007, 08:18:38 pm »
Quote
olaf
Sergeant!  Shoot that man - he's making sense!   ;D

Paolo
« Last Edit: August 15, 2007, 08:19:04 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #4 on: August 16, 2007, 02:35:25 pm »
Even if EA was to generate 100% of the data into the main portion of the XMI document instead of the extension my point still remains.  They are still incompatible versions of XMI.  However, I believe we have plans for an option to export to an EMF compatible metamodel.

PS. The example you have given, is an example of something that EA allows that isn't supported by the UML metamodel.  (An attribute type that isn't included in the current model)

olafk

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #5 on: September 05, 2007, 07:20:59 pm »
Ohhh, before I forget... (for the really keen so to speak):

Following a tiny little, weeny little link to the "EA Wiki" (thanks Paolo), and bit of further browsing, I ended up here: http://uml2ea.blogspot.com/. I used Ueli's utility with good success to export my sandpit EA model(s) to EMF/XMI. Certainly enough to get rolling...

And for those interested in MDA... Ueli has integrated this utility with oAW (openArchitectureWare); and I will attempt to do something similar with the latest version of AndroMDA.

ciao,
-olaf

Roger A. Shepherd

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #6 on: September 10, 2007, 04:45:26 am »
I must agree.
Code Generation Frameworks like AndroMDA and OpenArchitectureWare are mostly based on the EMF -Fromat.
Myself I am not "amused" to have another format like the official format from the OMG - but that's life.

What about the UML2 format, files with the extension .uml2. EA can import these files but cannot export them, or?
This will be my solution to use AndroMDA because it is using the uml2 format.
regards
Birgit Müller (Germany)

olafk

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #7 on: September 10, 2007, 02:55:56 pm »
Maybe I can ask for somebody to enlighten me please on the various "formats" of representing UML models (and their respective file extensions - accommodating all those PC guys who seem to insist on representing the format and content of a file through the, rather arbitrary, choice of file name extension).

First, we have UML models in two shapes: UML 1.x and UML 2.x. And, the second parameter is the representation of such a model in XMI (again, v1.x and v2.x).

Now, my experience has been that typically a UML 1.x model will be exported to a shape of XMI 1.x - with a file extension of .xmi or, possibly, .xml.

With the advent of UML 2.x (aka UML2), I seem to find that, analogous to the above, we export to XMI 2.x - again, with file extension of .xmi.

BUT, as Simon pointed out above, each model is expressed with respect to a meta-model. And there appear to be differences in these meta-models (as there reasonably would be - although I don't see why that effects the shape and form of the actual model in XMI as it comprises presumably standardized UML constructs). And so here we have it: the Eclipse EMF seemingly expects models to be expressed w.r.t. to the EMF/Ecore meta-model - and, thus, we have EMF/XMI. If this is correct, however, it begs the question as to what EA's meta-model is when exporting to XMI2? It's own... EA meta-model?

Am I correct in all of this? Please comment...

And, where does the file extension .uml2 fit in? Well, no idea... Somebody, please enlighten me ;-)

And, Birgit, BTW, unless you're using AndroMDA v4, EA exports of models into UML1/XMI1 work just fine. I have been using EA in conjunction with AndroMDA v3.x for some time now with very good success.

ciao,
-olaf

Roger A. Shepherd

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #8 on: September 19, 2007, 01:25:21 am »
That will not help me.
First I want to work with metafacades based on classes of the UML2 metamodel, because I work with the newest Features of AndroMDA3.3.
With XMI files AndroMDA can only operate on UML1.X features.

I cannot see a solution to work with the new modelelements in UML2 with EA and AndroMDA, without EMF/UML2 export.
Or is there a solution?
« Last Edit: September 19, 2007, 01:29:50 am by ea1205 »

olafk

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: XMI export to Eclipse/EMF
« Reply #9 on: September 19, 2007, 01:46:25 pm »
Apparently, in my (blanket) statement above (about AndroMDA v3.x), I was not quite precise enough: I use EA to export my models to UML1.4/XMI1.2 and then process such exported models with Andromda v3.2.

But, yes, Roger (or is it Birgit?), if AndroMDA v3.3 utilizes features only found in UML2, then you are possibly/probably quite correct. (Your comment would also holds for AndroMDA v3.2 where I have noticed emf/uml2 support. But I am not entirely certain as I have never looked into that...)

Out of interest, what exactly are the features of Andro that you've mentioned (i.e. those only available through the UML2 support)?

And, lastly, in my earlier post I mentioned that I successfully managed to export EA models to EMF/UML2/XMI2 (using said utility). Simple models, to be sure, but no reason not to give that a try...!?

ciao,
-olaf