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 |
urs zeidler 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 |
Eclipse User |
|
|
|
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 |
urs zeidler 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.
>
>
>
|
|
| |
Goto Forum:
Current Time: Fri Apr 19 19:53:05 GMT 2024
Powered by FUDForum. Page generated in 0.02871 seconds
|