Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] problem with generating Ecore DataTypes
[ATL] problem with generating Ecore DataTypes [message #34133] Wed, 25 April 2007 14:55 Go to next message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
In my transformation i have the problem to generate defined EDataTypes.
In the Ecore MetaModel there is a DataType Color and Font (the Topcased
Diagramconfigurator) when i try to run the transformation i got the
following error :
message: ERROR: cannot convert Color {255, 255, 255} : class
org.eclipse.swt.graphics.Color from EMF.


....
defaultBackgroundColor <- invar.defaultBackgroundColor,
....

that the following won't work i do understand, besides it's really pity :

....
defaultBackgroundColor <- '120,20,3',
....
which give me this error i can understand :
message: cannot set feature
OUTDDIA_MM!NodePartConfiguration.defaultBackgroundColor to value 0,1,2
exception:
java.lang.ClassCastException: java.lang.String

It is of course a class cast exception.

My question is how can i instantiate a EDataType,i didn't find somthin
in the manual, the FactoryImpl of the generated Package includes the
creation methods for the EdDtaTypes, but i don't know how to access it
inside an ATL transformation.

Perhaps i'm missing something.

thanks in advance, urs.
Re: [ATL] problem with generating Ecore DataTypes [message #34374 is a reply to message #34133] Thu, 26 April 2007 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikael.barbero.gmail.com

Hi Urs,

ATL only bind primary ecore's EDatatype (natural numbers -- int, float,
etc.. --, String etc.). There is no way for instantiating complex
EDatatype. As Color is complex, you should better use a Color Class
instead of datatype !

Best regards,
Mikael

PS: ATL is not Java nor EMF specific, then when you use something in EMF
made for the generated Java API, it is likely that it will not work.


urs zeidler wrote:
> In my transformation i have the problem to generate defined EDataTypes.
> In the Ecore MetaModel there is a DataType Color and Font (the Topcased
> Diagramconfigurator) when i try to run the transformation i got the
> following error :
> message: ERROR: cannot convert Color {255, 255, 255} : class
> org.eclipse.swt.graphics.Color from EMF.
>
>
> ...
> defaultBackgroundColor <- invar.defaultBackgroundColor,
> ...
>
> that the following won't work i do understand, besides it's really pity :
>
> ...
> defaultBackgroundColor <- '120,20,3',
> ...
> which give me this error i can understand :
> message: cannot set feature
> OUTDDIA_MM!NodePartConfiguration.defaultBackgroundColor to value 0,1,2
> exception:
> java.lang.ClassCastException: java.lang.String
>
> It is of course a class cast exception.
>
> My question is how can i instantiate a EDataType,i didn't find somthin
> in the manual, the FactoryImpl of the generated Package includes the
> creation methods for the EdDtaTypes, but i don't know how to access it
> inside an ATL transformation.
>
> Perhaps i'm missing something.
>
> thanks in advance, urs.



--
Mikaël Barbero - PhD Candidate
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssinière
44322 Nantes Cedex 3 - France
tel. +33 2 51 12 58 08 /\ cell.+33 6 07 63 19 00
email: Mikael.Barbero@{gmail.com, univ-nantes.fr}
http://www.sciences.univ-nantes.fr/lina/atl/
Re: [ATL] problem with generating Ecore DataTypes [message #34407 is a reply to message #34374] Thu, 26 April 2007 08:56 Go to previous messageGo to next message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
Thanks for your response, pity for the answer :) .
As this metamodel is a "3party" one, i can't change anything
(uri:http://www.topcased.org/diagramconfigurator/1.0).
But i will keep the issue in mind for own metamodels.

greetings, urs.

Mikaël Barbero schrieb:
> Hi Urs,
>
> ATL only bind primary ecore's EDatatype (natural numbers -- int, float,
> etc.. --, String etc.). There is no way for instantiating complex
> EDatatype. As Color is complex, you should better use a Color Class
> instead of datatype !
>
> Best regards,
> Mikael
>
> PS: ATL is not Java nor EMF specific, then when you use something in EMF
> made for the generated Java API, it is likely that it will not work.
>
>
> urs zeidler wrote:
>> In my transformation i have the problem to generate defined EDataTypes.
>> In the Ecore MetaModel there is a DataType Color and Font (the
>> Topcased Diagramconfigurator) when i try to run the transformation i
>> got the following error :
>> message: ERROR: cannot convert Color {255, 255, 255} : class
>> org.eclipse.swt.graphics.Color from EMF.
>>
>>
>> ...
>> defaultBackgroundColor <- invar.defaultBackgroundColor,
>> ...
>>
>> that the following won't work i do understand, besides it's really pity :
>>
>> ...
>> defaultBackgroundColor <- '120,20,3',
>> ...
>> which give me this error i can understand :
>> message: cannot set feature
>> OUTDDIA_MM!NodePartConfiguration.defaultBackgroundColor to value 0,1,2
>> exception:
>> java.lang.ClassCastException: java.lang.String
>>
>> It is of course a class cast exception.
>>
>> My question is how can i instantiate a EDataType,i didn't find somthin
>> in the manual, the FactoryImpl of the generated Package includes the
>> creation methods for the EdDtaTypes, but i don't know how to access it
>> inside an ATL transformation.
>>
>> Perhaps i'm missing something.
>>
>> thanks in advance, urs.
>
>
>
Re: [ATL] problem with generating Ecore DataTypes [message #34509 is a reply to message #34407] Thu, 26 April 2007 11:27 Go to previous message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
urs zeidler schrieb:
> Thanks for your response, pity for the answer :) .
> As this metamodel is a "3party" one, i can't change anything
> (uri:http://www.topcased.org/diagramconfigurator/1.0).
> But i will keep the issue in mind for own metamodels.
>
> greetings, urs.
>
An other solution would be to provide the model elements with methods to
set those values by String and delegate to the factory. So the values
are setable in the imperative part of the transformation. I have suggest
this solution for the topcased diagram configurator.

cu, urs.
Previous Topic:[ATL]should i use resolve temp??
Next Topic:[ATL] find a target element by resolveTemp
Goto Forum:
  


Current Time: Fri Jan 22 14:11:26 GMT 2021

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

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

Back to the top