Kenn,
If you were neither thousands of kilometers away, nor a man, I would
KISS you. By registering the UMLPackage for the URI of UML 2.1.2, my
model is indeed loading, standard output of MagicDraw UML (16.x) in a
stand-alone app outside of eclipse. I can see my classes, packages, etc.
Now to take the process further, there are two issues I need some
clarification on:
1. There are still a large number of AnyType instances in-between the
useful UML-related instances, is this normal? I suspect these are for
e.g. all the non-standard MagicDraw-specific elements present in the
model, e.g. diagram stuff, extensions, saved UI preferences, and so on.
In general, we don't want to care about any non-UML-standard elements,
so we are happy to ignore this.
2. In my sample UML model, I have class Person with attribute 'name' of
type 'string' from the UML standard profile. When I inspect (in code)
the class Person, I get the following:
Class: Person
- has a name of type
org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl@618821 (eProxyURI:
http://schema.omg.org/spec/UML/2.2/uml.xml#String)
Obviously, the UML Standard profile (even though the file is present,
next to the model file) is not loading (or loading properly). Could you
point me to the best guide to load a model such as this properly with
the UML standard profile, in order for me to e.g. access the name of the
Person as type String?
Unless I misunderstand, and that this is the way this works, i.e. the
UML2 project does not offer Java classes representing the UML standard
profile?
I basically just want to understand how the EMF UML2 project "deals"
with profiles, furthermore because I need to load other (non-standard)
profiles in the future.
kind (and very relieved) regards,
Dawid
Kenn Hussey het geskryf:
Dawid,
There is no default registration mapping the '2.1.2' version of the
"official" metamodel (there in fact was no such version) to the
Eclipse UML metamodel. You have two choices here - change the URI in
the document to use '2.1.1' or '2.2' as the version instead or
register the UML package against this URI.
The editor is opening the document, but I suspect many of the elements
are still being instantiated as generic AnyType elements...
Kenn