Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] KM3-Ecore primitive types mapping
[ATL] KM3-Ecore primitive types mapping [message #62053] Thu, 20 September 2007 08:40 Go to next message
Lorenzo Dalla Vecchia is currently offline Lorenzo Dalla VecchiaFriend
Messages: 58
Registered: July 2009
Member
Hello.

I have defined a metamodel in KM3 and injected it into a Ecore/XMI file: so
far so good.
Now, I want to manipulate the Ecore file with the Ecore API, loading it as a
resource and instantiating conforming models.

The problem is that KM3-generated Ecore files use a "PrimitiveTypes" package
with types as String, Boolean, etc. instead of using the standard built-in
Ecore types like EString e EBoolean: that prevents me from using Ecore API
to create conforming model as it seems not to know how to convert from a
Java String to a the KM3 String "primitive type", but only to Ecore standard
EString.

Is there a way to generate "standard" .ecore files from KM3?

Thanks.

--
Lorenzo
Re: [ATL] KM3-Ecore primitive types mapping [message #62124 is a reply to message #62053] Fri, 21 September 2007 19:23 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

> The problem is that KM3-generated Ecore files use a "PrimitiveTypes"
> package with types as String, Boolean, etc. instead of using the
> standard built-in Ecore types like EString e EBoolean: that prevents me
> from using Ecore API to create conforming model as it seems not to know
> how to convert from a Java String to a the KM3 String "primitive type",
> but only to Ecore standard EString.

Actually, I believe the problem is that the EDataTypes created by the
KM3 to Ecore transformation do not have an appropriate value for
instanceClassName.


> Is there a way to generate "standard" .ecore files from KM3?

We do not like to have our metamodels point to Ecore elements (e.g.,
EString, EInteger). The reason is that, in such a case, the metamodel
somehow becomes an extension of the metametamodel.

That being said, you can always modify the KM3 to Ecore transformation
to use EString, EInteger, etc. Or, you may also change this
transformation to initialize the instanceClassName attributes of the
generated EDataTypes. The transformation is available in the ATL
transformation zoo:
http://www.eclipse.org/m2m/atl/atlTransformations/#KM32EMF


Future versions of KM3 will come with this mechanism built-in ;-).


Regards,

Frédéric Jouault
Re: [ATL] KM3-Ecore primitive types mapping [message #62172 is a reply to message #62124] Sat, 22 September 2007 09:47 Go to previous message
Lorenzo Dalla Vecchia is currently offline Lorenzo Dalla VecchiaFriend
Messages: 58
Registered: July 2009
Member
Thanks for the detailed reply.

I was already given the tip of setting instanceClassName on the EMF
newsgroup and for the time being I'll be fine with that. Now I understand
that KM3 wants to be a "neutral" M3 language.
I will just wait for KM3 annotations to clean up the code.

Thanks again!

--
Lorenzo
Previous Topic:[ATL] Injector development: emitting ecore
Next Topic:[M2M] [Fwd: Re: resolving volatile references]
Goto Forum:
  


Current Time: Sun Apr 11 02:15:33 GMT 2021

Powered by FUDForum. Page generated in 0.02161 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top