[ATL] EMF primitive types [message #37071] |
Fri, 11 May 2007 06:56  |
Eclipse User |
|
|
|
I'm using a transformation that is designed to move a metamodel
from the km3 metametamodel space into the emf metametamodel
space. As part of this I'd like to change the type of an attribute
to one of the EMF primitive types, e.g. EString. Is this possible
with an ATL transformation?
I've tried setting the appropriate instanceClassName on the
primitive types in the KM3 metamodel. This allows me to
generate an implementation of the EMF form of the metamodel.
However, this is not sufficient for MOFScript to load the
metamodel, it appears that this required the attribute type
changes mentioned above.
Andy.
--
-- ------------------------------------------------------------ -------------
Dr Andy Carpenter
School of Computer Science,
University of Manchester, Manchester M13 9PL, UK
Email: Andy.Carpenter@manchester.ac.uk
Tel: +44 161 275 6168
Fax: +44 161 275 6280
|
|
|
Re: [ATL] EMF primitive types [message #37737 is a reply to message #37071] |
Tue, 15 May 2007 01:34  |
Eclipse User |
|
|
|
Hello,
> I'm using a transformation that is designed to move a metamodel
> from the km3 metametamodel space into the emf metametamodel
> space. As part of this I'd like to change the type of an attribute
> to one of the EMF primitive types, e.g. EString. Is this possible
> with an ATL transformation?
Yes, this is possible. You will however need to allow inter-model
references (see advanced tab in launch config), so that you may
initialize a property of a given target element with an element (i.e.,
EString) coming from another model (i.e., the metametamodel).
Then you can write something like:
type <- Ecore!DataType.allInstancesFrom('Ecore')->any(e | e.name =
'EString')
Note that I assumed that you declared Ecore : Ecore as a source model,
and referenced it "by URI" in the launch config.
Regards,
Frédéric Jouault
|
|
|
Powered by
FUDForum. Page generated in 0.02925 seconds