Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [TCS] Referencing
[TCS] Referencing [message #82623] Wed, 28 May 2008 18:12 Go to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi all,

I'm using TCS and I need to serialize elements with complex references.
Not to complicate it more with my metamodel, I would introduce what I
want to do with the KM3 metamodel example.

Suppose that when serializing a KM3 reference, I would like to print all
the names of its containing class supertypes. I would like to do
something like that(last line):

template Reference addToContext:
"reference" name $multiplicity (isContainer? "container")
":" type{refersTo= name, autoCreate= never}
(isDefined(opposite) ? "oppositeOf" opposite{refersTo= name, lookIn=
type, autoCreate= never})
owner.superTypes{refersTo = name, separator = ","} ";";

But TCS does not allow me (i can not use the dot (owner.superTypes) as I
expected). Is there any way to handle it?

Thanks in advance,
Jose E. Rivera
Re: [TCS] Referencing [message #82693 is a reply to message #82623] Thu, 29 May 2008 18:57 Go to previous messageGo to next message
Freddy Allilaire is currently offline Freddy AllilaireFriend
Messages: 130
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080301000608030007040407
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Jose,

Please use the TMF newsgroup for TCS questions. I've added it to the
"to" list of the reply.

Freddy.

Jose E. Rivera a
Re: [TCS] Referencing [message #82882 is a reply to message #82693] Fri, 30 May 2008 09:05 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 Jose,

I am not sure to understand what you mean. Could you please give a code
example following your TCS specification the way you would like it to work?

Thanks,

Frédéric Jouault

Freddy Allilaire a écrit :
> Hi Jose,
>
> Please use the TMF newsgroup for TCS questions. I've added it to the
> "to" list of the reply.
>
> Freddy.
>
> Jose E. Rivera a écrit :
>> Hi all,
>>
>> I'm using TCS and I need to serialize elements with complex
>> references. Not to complicate it more with my metamodel, I would
>> introduce what I want to do with the KM3 metamodel example.
>>
>> Suppose that when serializing a KM3 reference, I would like to print
>> all the names of its containing class supertypes. I would like to do
>> something like that(last line):
>>
>> template Reference addToContext:
>> "reference" name $multiplicity (isContainer? "container")
>> ":" type{refersTo= name, autoCreate= never}
>> (isDefined(opposite) ? "oppositeOf" opposite{refersTo= name, lookIn=
>> type, autoCreate= never})
>> owner.superTypes{refersTo = name, separator = ","} ";";
>>
>> But TCS does not allow me (i can not use the dot (owner.superTypes) as
>> I expected). Is there any way to handle it?
>>
>> Thanks in advance,
>> Jose E. Rivera
>
Re: [TCS] Referencing [message #83396 is a reply to message #82882] Mon, 02 June 2008 11:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi,

For example, given the KM3 metamodel as well (class "Reference"), I
would like to produce something like:

class Reference extends StructuralFeature {
attribute isContainer : Boolean;
reference opposite[0-1] : Reference StructuralFeature;
}

Note "StructuralFeature" printed at the end of the reference "opposite".
I would need to access from a "Reference" to the supertypes of its owner...
I would like to write in TCS something like:
owner.supertypes{refersTo = name, separator = ","} ";";
(In the example there is only one supertype) Is there any way to do it?

Yhank you very much,
Jose

Frédéric Jouault escribió:
> Hi Jose,
>
> I am not sure to understand what you mean. Could you please give a code
> example following your TCS specification the way you would like it to work?
>
> Thanks,
>
> Frédéric Jouault
>
> Freddy Allilaire a écrit :
>> Hi Jose,
>>
>> Please use the TMF newsgroup for TCS questions. I've added it to the
>> "to" list of the reply.
>>
>> Freddy.
>>
>> Jose E. Rivera a écrit :
>>> Hi all,
>>>
>>> I'm using TCS and I need to serialize elements with complex
>>> references. Not to complicate it more with my metamodel, I would
>>> introduce what I want to do with the KM3 metamodel example.
>>>
>>> Suppose that when serializing a KM3 reference, I would like to print
>>> all the names of its containing class supertypes. I would like to do
>>> something like that(last line):
>>>
>>> template Reference addToContext:
>>> "reference" name $multiplicity (isContainer? "container")
>>> ":" type{refersTo= name, autoCreate= never}
>>> (isDefined(opposite) ? "oppositeOf" opposite{refersTo= name,
>>> lookIn= type, autoCreate= never})
>>> owner.superTypes{refersTo = name, separator = ","} ";";
>>>
>>> But TCS does not allow me (i can not use the dot (owner.superTypes)
>>> as I expected). Is there any way to handle it?
>>>
>>> Thanks in advance,
>>> Jose E. Rivera
>>
Re: [TCS] Referencing [message #84549 is a reply to message #83396] Fri, 13 June 2008 14:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi,

since I have got no answer, can I assume that TCS does not allow to do
these kind of things?

Regards,
Jose E. Rivera

Jose E. Rivera escribió:
> Hi,
>
> For example, given the KM3 metamodel as well (class "Reference"), I
> would like to produce something like:
>
> class Reference extends StructuralFeature {
> attribute isContainer : Boolean;
> reference opposite[0-1] : Reference StructuralFeature;
> }
>
> Note "StructuralFeature" printed at the end of the reference "opposite".
> I would need to access from a "Reference" to the supertypes of its owner...
> I would like to write in TCS something like:
> owner.supertypes{refersTo = name, separator = ","} ";";
> (In the example there is only one supertype) Is there any way to do it?
>
> Yhank you very much,
> Jose
>
> Frédéric Jouault escribió:
>> Hi Jose,
>>
>> I am not sure to understand what you mean. Could you please give a
>> code example following your TCS specification the way you would like
>> it to work?
>>
>> Thanks,
>>
>> Frédéric Jouault
>>
>> Freddy Allilaire a écrit :
>>> Hi Jose,
>>>
>>> Please use the TMF newsgroup for TCS questions. I've added it to the
>>> "to" list of the reply.
>>>
>>> Freddy.
>>>
>>> Jose E. Rivera a écrit :
>>>> Hi all,
>>>>
>>>> I'm using TCS and I need to serialize elements with complex
>>>> references. Not to complicate it more with my metamodel, I would
>>>> introduce what I want to do with the KM3 metamodel example.
>>>>
>>>> Suppose that when serializing a KM3 reference, I would like to print
>>>> all the names of its containing class supertypes. I would like to do
>>>> something like that(last line):
>>>>
>>>> template Reference addToContext:
>>>> "reference" name $multiplicity (isContainer? "container")
>>>> ":" type{refersTo= name, autoCreate= never}
>>>> (isDefined(opposite) ? "oppositeOf" opposite{refersTo= name,
>>>> lookIn= type, autoCreate= never})
>>>> owner.superTypes{refersTo = name, separator = ","} ";";
>>>>
>>>> But TCS does not allow me (i can not use the dot (owner.superTypes)
>>>> as I expected). Is there any way to handle it?
>>>>
>>>> Thanks in advance,
>>>> Jose E. Rivera
>>>
Re: [TCS] Referencing [message #86234 is a reply to message #83396] Wed, 09 July 2008 14:39 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

When you put StructuralFeature after Reference you are duplicating
information that is already in the definition of Reference.

What would you want to happen: 1) redefinition of the supertypes of
Reference, or 2) comparison of both definitions that generates an error
if they are inconsistent?


I must admit that I do not understand the point of your example. An
actual example may help me to understand what you want to do.


In any case, a simple work-around is to parse with a slightly modified
metamodel (with the corresponding structure), then use model
transformation to get to your actual metamodel.


Regards,

Frédéric Jouault


Jose E. Rivera a écrit :
> Hi,
>
> For example, given the KM3 metamodel as well (class "Reference"), I
> would like to produce something like:
>
> class Reference extends StructuralFeature {
> attribute isContainer : Boolean;
> reference opposite[0-1] : Reference StructuralFeature;
> }
>
> Note "StructuralFeature" printed at the end of the reference "opposite".
> I would need to access from a "Reference" to the supertypes of its owner...
> I would like to write in TCS something like:
> owner.supertypes{refersTo = name, separator = ","} ";";
> (In the example there is only one supertype) Is there any way to do it?
>
> Yhank you very much,
> Jose
>
> Frédéric Jouault escribió:
>> Hi Jose,
>>
>> I am not sure to understand what you mean. Could you please give a
>> code example following your TCS specification the way you would like
>> it to work?
>>
>> Thanks,
>>
>> Frédéric Jouault
>>
>> Freddy Allilaire a écrit :
>>> Hi Jose,
>>>
>>> Please use the TMF newsgroup for TCS questions. I've added it to the
>>> "to" list of the reply.
>>>
>>> Freddy.
>>>
>>> Jose E. Rivera a écrit :
>>>> Hi all,
>>>>
>>>> I'm using TCS and I need to serialize elements with complex
>>>> references. Not to complicate it more with my metamodel, I would
>>>> introduce what I want to do with the KM3 metamodel example.
>>>>
>>>> Suppose that when serializing a KM3 reference, I would like to print
>>>> all the names of its containing class supertypes. I would like to do
>>>> something like that(last line):
>>>>
>>>> template Reference addToContext:
>>>> "reference" name $multiplicity (isContainer? "container")
>>>> ":" type{refersTo= name, autoCreate= never}
>>>> (isDefined(opposite) ? "oppositeOf" opposite{refersTo= name,
>>>> lookIn= type, autoCreate= never})
>>>> owner.superTypes{refersTo = name, separator = ","} ";";
>>>>
>>>> But TCS does not allow me (i can not use the dot (owner.superTypes)
>>>> as I expected). Is there any way to handle it?
>>>>
>>>> Thanks in advance,
>>>> Jose E. Rivera
>>>
Previous Topic:[ATL] Varying rule behavior
Next Topic:[ATL] Testing transformation rules
Goto Forum:
  


Current Time: Tue Apr 16 20:25:32 GMT 2024

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

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

Back to the top