Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [QVTO] mapping to EType
[QVTO] mapping to EType [message #537763] Thu, 03 June 2010 14:35 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,


When using QVTO, to generate an ecore, I run into this challenge
to produce a valid value for an EAttribute.eType. It needs to be an
EClassifier, which I would expect is a bunch of type literals I can
simply assign. I am not able to locate these literals.

In the end, the serialized eType value should something like this:

"ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"

I can generate it, but it would become a new type, instead of a
reference to an existing Literal.

What would be the solution for this?

thank you,

Christophe Bouhier
Re: [QVTO] mapping to EType [message #537770 is a reply to message #537763] Thu, 03 June 2010 15:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Christophe,

Things like XMLTypePackage.Literals.STRING would do the trick in Java.
I'm not sure about QVTo.


Christophe Bouhier wrote:
> Hi,
>
>
> When using QVTO, to generate an ecore, I run into this challenge
> to produce a valid value for an EAttribute.eType. It needs to be an
> EClassifier, which I would expect is a bunch of type literals I can
> simply assign. I am not able to locate these literals.
>
> In the end, the serialized eType value should something like this:
>
> "ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
>
> I can generate it, but it would become a new type, instead of a
> reference to an existing Literal.
>
> What would be the solution for this?
>
> thank you,
>
> Christophe Bouhier


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [QVTO] mapping to EType [message #537805 is a reply to message #537763] Thu, 03 June 2010 17:16 Go to previous messageGo to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 51
Registered: August 2009
Member
This works for Ecore types:
modeltype Ecore "strict" uses 'http://www.eclipse.org/emf/2002/Ecore';
...
eType := Ecore::EString.oclAsType(EClassifier); 

And this should work for XMLTypes:
modeltype XMLType "strict" uses 'http://www.eclipse.org/emf/2003/XMLType';
...
eType := XMLType::String.oclAsType(EClassifier);
Re: [QVTO] mapping to EType [message #537851 is a reply to message #537763] Thu, 03 June 2010 20:22 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Christophe ,

There were already similar threads. Please have a look at

http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg03742.html
another approach for Ecore primitive types referencing

http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg03752.html
ECore primitive types referencing with help of black-box

http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg03939.html
for UML primitive types referencing


Regards,
Sergey

> Hi,
>
>
> When using QVTO, to generate an ecore, I run into this challenge
> to produce a valid value for an EAttribute.eType. It needs to be an
> EClassifier, which I would expect is a bunch of type literals I can
> simply assign. I am not able to locate these literals.
>
> In the end, the serialized eType value should something like this:
>
> "ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
>
> I can generate it, but it would become a new type, instead of a
> reference to an existing Literal.
>
> What would be the solution for this?
>
> thank you,
>
> Christophe Bouhier
Re: [QVTO] mapping to EType [message #537930 is a reply to message #537805] Fri, 04 June 2010 08:17 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Thx Alex
Indeed it works.

Alex wrote:
> This works for Ecore types:
> modeltype Ecore "strict" uses 'http://www.eclipse.org/emf/2002/Ecore';
> ..
> eType := Ecore::EString.oclAsType(EClassifier); And this should work for
> XMLTypes:
> modeltype XMLType "strict" uses 'http://www.eclipse.org/emf/2003/XMLType';
> ..
> eType := XMLType::String.oclAsType(EClassifier);
>
Previous Topic:EditingDomain (ChangeRecorder)
Next Topic:Running CDO Server using Teneo in Standalone
Goto Forum:
  


Current Time: Thu Apr 18 02:20:50 GMT 2024

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

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

Back to the top