Book a Demo

Author Topic: Export to xmi  (Read 3138 times)

mikaeel

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Export to xmi
« on: July 07, 2008, 06:41:58 pm »
Hi there,
I have a package with just a class model in it.  The model contains x number of classes.  These classes reside across many other packages in my repository.   I need to send the model to someone so that they can import it into another tool.
I've noticed that in order to share my model, the export to xmi works on a package level and the classes must be contained within the package being exported.
This is my issue because my classes span across many packages.  This means I will have to export the top most package and all sub-packages.  And this will  include ALL classes in the repository.
Is there a way to export in such a way that the output includes only the classes that are in context of my class model.
I don't want to have to force all the classes into one package (i.e. copy and paste as new).

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Export to xmi
« Reply #1 on: July 07, 2008, 11:35:51 pm »
Think about what your colleague will see after loading your XMI file.

If you want the end result to look just the way you've done it, then you will have to create all the external packages in the target project. Since there's no way to guarantee the completeness or integrity of these packages - compared to your current project - they would have to be recreated and populated from scratch. Thus, you'd need to send the whole 'large' export.

If you only want to replicate the classes themselves, without the package structure, you would have to create such a 'thing' before you did the extract. [Otherwise you'd have nothing to export, so your colleague would have nothing to import.]

It sounds like a restriction, but actually it is not. XMI is designed to transport models or sections thereof, and faithfully reproduce the source model at the target. You have to create the source in the same form as the one that will be restored. This constraint is not imposed by EA, but by the design of XMI.

[edit]But see Simon's post below for an exception.[/edit]
« Last Edit: July 08, 2008, 11:57:35 pm by Midnight »
No, you can't have it!

mikaeel

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Export to xmi
« Reply #2 on: July 08, 2008, 03:03:11 pm »
Hi,
Look at the following scenario:

Package 1
   - class A
   - class B
   -  ....
   -  ....
   - class J
Package 2
   - class K
   - class L
   - class M
   - class N
Package 3
   - class 1
   - class 2
   - ...
   - ...
   - class 29
Package 4
   - Class Diagram X

Lets say that Class Diagram X comprises of class A, class B, class E, class N, class 2, class 19, class 23. only.
Isn't it possible for EA to look at the context of Class Diagram X and produce and xmi export that will only contain the classes and relationships for the classes in Class Diagram X.  So, when the xmi is imported on the other side, it will look like this:

Package 1
   - class A
   - class B
   - class E
Package 2
   - class N
Package 3
   - class 2
   - class 19
   - class 23
Package 4
   - Class Diagram X

Hence, the package structure is still maintained.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Export to xmi
« Reply #3 on: July 08, 2008, 04:08:49 pm »
The only time that an XMI export from EA looks at a diagram is when exporting a pattern.  I think in that situation the package structure is lost.

Besides that, if you had tried exporting a pattern then importing directly as XMI again (not sure what you would have to do to try this) importing a package in EA would overwrite the existing package if one of that guid is present and remove any classes found in it.  If that doesn't bother you, maybe it is worth a try...

But, your answer is no, it can't be done at the moment.