Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsEDate in the transformations
https://www.eclipse.org/forums/index.php/mv/msg/440658/987586/#msg_987586
One of my metamodels have some attributes defined as EDate, but now in the transformation I can't find the way to work with them. I mean I can't define, e.g. a helper as helper def : getDate(....) : EDate = ..., or as helper def : getSomething (...) : String = let a : Sequence(Edate) = MM!Command.allInstances()->collect(i | i.date) in ...
How can I do? Do I have to specify that EDate is an Ecore data-type?, but how?
Best regards,]]>Aran A2012-11-27T09:26:28-00:00Re: EDate in the transformations
https://www.eclipse.org/forums/index.php/mv/msg/440658/987684/#msg_987684
Sorry, I insist on this issue again, but I'm really stuck with it.
I haven't defined a custom or special EDate, I'm just using the Ecore data type. So, I understand that I don't have to rewrite the createXXXXFromString(EDataType eDataType, String initialValue) and convertXXXXToString(EDataType eDataType, Object instanceValue). That is for custom data types, isn't it?
With Strings I can define:
let aux: String = 'xxx' in ...
or
let aux: Sequence(String) = Sequence{'xx', 'zz'} in ...
So, with EDate I would like to do the same:
let aux: EDate = .... in ...
or
let aux: Sequence(EDate) = Sequence{....} in ...
Do I need something more in the ATL module specification? or what is that I am misunderstanding? I would appreciate any clue.
Thanks in advance,
]]>Aran A2012-11-27T15:22:55-00:00Re: EDate in the transformations
https://www.eclipse.org/forums/index.php/mv/msg/440658/987786/#msg_987786
In so far as ATL follows the OCL specification, you cannot construct
DataType (or Class objects).
There have been a number of suggestions for object construction in OCL.
The new Pivot-based Eclipse OCL prototypes a solution re-using the Tuple
syntax: MyClass{name="myName} for classes and the Collection syntax
ecore::EDate{"20-Nov-2011"} for datatypes.
For now, I suspect that you may need Java helper functions.
Regards
Ed Willink
On 27/11/2012 15:23, Aran A wrote:
> Hi,
>
> Sorry, I insist on this issue again, but I'm really stuck with it.
> I haven't defined a custom or special EDate, I'm just using the Ecore
> data type. So, I understand that I don't have to rewrite the
> createXXXXFromString(EDataType eDataType, String initialValue) and
> convertXXXXToString(EDataType eDataType, Object instanceValue). That
> is for custom data types, isn't it?
>
> With Strings I can define:
>
> let aux: String = 'xxx' in ...
> or
> let aux: Sequence(String) = Sequence{'xx', 'zz'} in ...
>
> So, with EDate I would like to do the same:
>
> let aux: EDate = .... in ...
> or
> let aux: Sequence(EDate) = Sequence{....} in ...
>
> Do I need something more in the ATL module specification? or what is
> that I am misunderstanding? I would appreciate any clue.
>
> Thanks in advance,
>]]>Ed Willink2012-11-28T07:42:06-00:00Re: EDate in the transformations
https://www.eclipse.org/forums/index.php/mv/msg/440658/987825/#msg_987825
I'm really disappointed...I thought it was a 'silly' issue.
Many, many thanks for your answer. I'm not sure if I catch on the idea about using the Tuple syntax, but probably I will change the metamodel to avoid the EDate attribute .
You mention the "Java helper functions". I didn't know about them and I don't find anything, please, could you give me a reference?