|[AM3] Gap between AM3 and EMF? [message #560657]
||Tue, 16 January 2007 14:15
| Stefan Winkler
Registered: July 2009
I am just starting a research project with the goal to use modeling
technology as a basis for content-level linking of different documents
and artifacts in the requirements engineering area. So I am basically
going to use modeling technology not to do code generation but to do
navigation, transformation and projection.
As I started working with ATL, AM3, KM3 and so on, I wanted to set up a
chain of steps like this:
- provide a metamodel in KM3
- transform the metamodel to ecore ("Inject KM3 to Ecore metamodel")
- generate an emf editor in the future, just now I'm sticking with the
EMF dynamic reflective model editor
- create a instance of the metamodel (currently using "Create dynamic
- edit the resulting model using the (currently dynamic) editor.
I tried this using one of the standard metamodels in the atlantic zoo:
However, the above does not work out of the box, because of two reasons,
as I figured out:
1. In the ecore metamodel there is an EPackage "Person" with the
Property "Ns URI" not set. This results in an exception
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
'null' not found. (platform:/resource/km3toecore/Person.xmi, 4, 51) when
opening the dynamic instance.
Remedy: Setting "Ns URI" in Person.ecore to somethin more or less useful
before creating the dynamic instance, the Namespace URI is used and the
model is ok.
2. When the model is opened in the dynamic reflective editor, model
properties can not be edited. While it is possible to enter values for
the properties, the input is discarded as soon as return is pressed.
Remedy: As I found out, this is because the properties are typed with
data types in the PrimitiveTypes package. The data types (like String)
there do not have the "Instance Class Name" property set. When setting
this to appropriate classes, like java.lang.String, java.lang.Integer,
etc. the reflective Editor works and values can be entered -> the model
can be fully edited.
So my question is: Why is there a gap between the KM3-to-Ecore component
and the Ecore editor? What I did to get the above working is nothing
that could not be generated programmatically.
So what am I missing?
Is it because the KM3-to-Ecore converter wants to be as generic as
possible and so does not hard-code the Ns URI and data type to class
Hoping for some answers...
Powered by FUDForum
. Page generated in 0.01719 seconds