Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Ericga on April 16, 2010, 12:53:32 am

Title: How to reimport the same package?
Post by: Ericga on April 16, 2010, 12:53:32 am
Hello,

I simply need to refresh all classes I previously imported though an XMI file. I have an updated XMI to import but I am getting duplicates instead of just the update I am looking for. I can delete the old ones but I will lose all diagrams.

What is the simplest way to do this?

thanks

Eric
Title: Re: How to reimport the same package?
Post by: Nizam Mohamed on April 16, 2010, 09:17:31 am
Re importing the same XMI over the same package(by selecting the package before import) should update the model with the latest from XMI.

You might as well do a compare with XMI (if you have XMI 1.1), and merge from baseline to the model.
Title: Re: How to reimport the same package?
Post by: mrf on April 16, 2010, 09:25:32 am
Also ensure that you don't have the option "Strip GUIDS" checked when performing the import. This removes the identification key that EA uses to match the content in the XMI to that of the model.
Title: Re: How to reimport the same package?
Post by: Ericga on April 16, 2010, 10:12:05 pm
Thank you for answering. Maybe the root of the issue is the absence of UUID in the XMI. Is there a way to deal with that?

If there is not, and I want to attempt modifying the XMI to include globally unique identifiers, do I need to use real GUIDs? The XMI standards seems to accept any kind of string with the propperper prefix: The values of this attribute should be globally unique strings prefixed by the type of identifier. There is also an example in the standard that uses a simple string:

<UML:Operation xmi:id="idO1" xmi:label="op1" xmi:uuid="DCE:1234">

So if I have to make up my own UUIDs, my questions are:

1) is there a recommendation about the prefix that should be used? DCE seems to be reserved and I am not sure if I cam improvise one?

2) If any string can be used (i.e. not necessarily GUID-like) is there any limitation in length?

Thanks again for any tip

Eric
Title: Re: How to reimport the same package?
Post by: Geert Bellekens on April 16, 2010, 11:07:19 pm
Eric

I think EA looks at the ea_guid's in the xmi file. I think there are stored in an EA specific xmi extension.
Try exporting a simple package with one class and inspect the xmi file.

Geert
Title: Re: How to reimport the same package?
Post by: Ericga on April 16, 2010, 11:26:11 pm

Geert,

If it is an EA specific extension, how can I re-import XMI that was generated by another system? (an OO database in this case)


Eric
Title: Re: How to reimport the same package?
Post by: Geert Bellekens on April 16, 2010, 11:50:44 pm
I don't think you can.

Geert
Title: Re: How to reimport the same package?
Post by: Ericga on April 16, 2010, 11:56:14 pm
 One can't expect code to be static so how can I resynch then?
Title: Re: How to reimport the same package?
Post by: Ericga on April 16, 2010, 11:58:45 pm

Nizam,

You said:

> You might as well do a compare with XMI (if you have XMI 1.1), and merge from baseline to the model.

How can I compare and merge? This seems a possible solution.
Title: Re: How to reimport the same package?
Post by: Ericga on April 17, 2010, 12:46:26 am
I tried to follow Nizam's suggestion. I have found the Manage Baselines... menu. I am not familiar yet with that functionality but the menu doesn't do anything. I also found Compare from XMI in Package Control but got this error:

Error: Unable to compare to file. Requires XMI 1.1 from Enterprise Architect.

So I assume EA compare tool is only compatible with EA XMI and not with XMI standard files in general.

Eric
Title: Re: How to reimport the same package?
Post by: beginner on April 17, 2010, 12:53:21 am
You obviously found out that XMI is not XMI, unfortunately.

b.
Title: Re: How to reimport the same package?
Post by: Ericga on April 17, 2010, 06:42:23 am

Back to square 1: is there no solution to re-import a package?
Title: Re: How to reimport the same package?
Post by: Gary W. on April 17, 2010, 08:56:35 am
Then it's really 'migrate' rather than 're-import', and as others have said, "XMI" is really 100% transferrable between vendors (ALL vendors, not just Sparx).

There are products out there to do just that (e.g. http://www.metaintegration.net/Products/MIMB/MicrosoftVisio.html) but they're usually REALLY expensive.

What was the product that originally created the XMI?

Title: Re: How to reimport the same package?
Post by: Nizam Mohamed on April 19, 2010, 09:13:53 am
Eric,
      EA can import from other XMI, but will generate EA specific UIDs in the process. so changing the original(non-EA) XMI and attempting to re-synch will most likely result in duplication of packages as you've mentioned.

You might as well write to sparxsupport ([email protected]) with some details on how the XMI was originally created, for a more elaborate response.
Title: Re: How to reimport the same package?
Post by: Ericga on April 19, 2010, 10:02:16 am
Thanks. I might resort to that but I have never had any luck with sparx support. I've asked for 2 years to display entity names in diagrams without truncating them and I have never even been able to make them admit it's ludicrous the fully qualified name is not available in the properties dialog of an entity, so I won't start discussing something as complex as XMI with sparx's support when it's not possible to make them admit something obvious.

The current limitations with XMI are frustrating but I can certainly understand why they exists and why sparx has not removed them. It's probably a lot of work and there probably are feature requests with higher priorities.

An EA project seems to be an access database (at least I can open it with it). I can't say I like Access but if I can find time to figure out the schema it should be possible to update all tuples defining a diagram to use the same objects from another model and then delete the original one. I of course define "same objects" in this case as objects with the same fully qualified names.

eric
Title: Re: How to reimport the same package?
Post by: Geert Bellekens on April 19, 2010, 04:32:14 pm
Eric,

My experience is that Sparx support is really helpful when faced with a user problem, so it is worth a shot.

As to doing the synchronise yourself, I wouldn't go through the database but rather use the API.

I've written an little program myself a while ago to fix a similar issue.

We had several EA models that had a shared part with common datatypes and stuff. For some reason something went wrong with the manual export/import of this common model and we ended up with elements that had different GUID's in different models.

Then we decided to merge the different models into one bug model (e.g. database).
To solve the issue with the different GUID's I merged the xmi's from the different versions of our common model.
The result was that some classes appeared twice, but with a different GUID.
Then I wrote a program in C# to loop all elements in my duplicates package, find the corresponding element in my "real" package, and replace all occurences of the duplicate element with the "real" element.
Things to look for are:
- usage of element as type of attribute
- usage of element as type of parameter
- usage of element as returntype of operation
- usage of element on diagrams
- usage of element in relations.

For most usages it was enough to replace the duplicate elementID with the real elementID. Only DiagramObjects were a bit difficult since I had to recreate the diagramObject iso just being able to replace the elementID.

Regards

Geert
Title: Re: How to reimport the same package?
Post by: beginner on April 20, 2010, 04:24:02 am
Right and wrong, Geert. In contrast to other companies which are doing absolutely nothing and thus not runnig in the problem of doing the wrong thing, Sparx are doing quite a lot. But unfortunately often the wrong thing. Reasons for that have been discussed in broad. I have uncounted open bug reports compared to a few realized enhancements. I better like to see correction of bugs rather than another source of  bugs in form of a new feature. The situation is getting worse. Some years ago it was nice to see a lot of enhancements coming fast. Now it's time for a redesign of EA coming fast. Or at least a (more) bug free system.

b.