Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Jan van Mastbergen on August 06, 2007, 01:00:37 am
-
Hi,
I am trying to import a database model in an odd format into EA by generating UML1.3/XMI1.1 files. I am using the xmi.id and xmi.idref attributes to link elements. So far so good.
In the end several models or variants thereof will be imported in different packages in the same EA database.
All the models share a small number of basic data types like integer, string timestamp etc. What I would like to avoid is that these are regenerated on each import. Instead I would like to preload a database with these shared definitions and have the imported models refer to them. How to achieve this?
A few attempts have been made:
a) I manually entered the types, exported to UML1.3/XMI1.1 and then hard-coded the xmi.id values into xmi.idref's in the generated model. No success. The attribute type remains empty. Note that the same construct works perfectly for attribute types defined within the .xmi file.
b) Same as a) but encoded in xmi.uuidref attributes. Same result as with a)
Generated XML to specify the data typ of an imported attribute 'value' looks like this:
<UML:Class name=...
<UML:Classifier.feature>
<UML:Attribute name="value" changeable="none" visibility="public" ownerScope="instance" targetScope="instance">
<UML:StructuralFeature.type>
<UML:Classifier xmi.uuidref="EAID_894A76FF_A44C_4550_A258_F0C4AE825143"/>
</UML:StructuralFeature.type>
</UML:Attribute>
</UML:Classifier.feature>
</UML:Class>
TIA, Jan
-
I hope I understood you right.
You want to have a base model with clasifier and load XMI files with classes inherited from them, is it OK?
If so what you can do is just create a template model with classes inheriting from the base class, export it to XMI and just change the inherited classes in it.
I did something like it to change relations. though i did never try to change classifier (and it was loooong ago...)
-
Hi Martin,
Close but not quite. Inheritance is not an issue at the moment. What I want to do is define the type of imported attributes to be one of the predefined ones. There are several hundred attributes in my model. The predefined ones are regular classes. When I find the method to do this I expect I can easily extend the approach to make imported classes inherit from predefined ones.
Regards, Jan
-
Just for the curiosity - have you tried reverse engineering EA XMIs (very simple examples) to create your template XMI files?
-
Yep, that's precisely what I am doing. I build an example target structure by hand, export the XMI and use that as template for my conversion script.
Jan
-
???
Well...I guess then you have some debugging work to do ::)
May creating a file, exporting and then changing it through copy-paste can help figure out the mechanism...sorru I can help more...