Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] summarising/decorating a model
[ATL] summarising/decorating a model [message #101786] Fri, 13 March 2009 10:51 Go to next message
Andy Carpenter is currently offline Andy CarpenterFriend
Messages: 145
Registered: July 2009
Senior Member
I'm trying to write a transform that populates an output model
that summaries the input model with references back to the
original input model. I can produce the summary information
but the references that should point back to the input model
get transformed into references in the output model. Clearly
this is the correct standard behaviour. Is there a way that
I can actually have references from the output model
back to the input model?

thanks
Andy.


--
-- ------------------------------------------------------------ -------------
Dr Andy Carpenter
School of Computer Science,
University of Manchester, Manchester M13 9PL, UK
Email: Andy.Carpenter@manchester.ac.uk
Tel: +44 161 275 6168
Fax: +44 161 275 6280
Re: [ATL] summarising/decorating a model [message #101970 is a reply to message #101786] Mon, 16 March 2009 14:47 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Andy Carpenter wrote:
> I'm trying to write a transform that populates an output model
> that summaries the input model with references back to the
> original input model. I can produce the summary information
> but the references that should point back to the input model
> get transformed into references in the output model. Clearly
> this is the correct standard behaviour. Is there a way that
> I can actually have references from the output model
> back to the input model?
>
> thanks
> Andy.
>
>

Since you're translating the source elements in question in the same
transformation, they are automatically translated in each assignment
('<-'). Therefore, you have to avoid using '<-' for every case in which
you don't want the automatic tracing mechanism to kick in.

This can be done with the 'refSetValue(name : String, val : oclAny)'
operation. You can use this operation in the imperative "do" section of
a matched rule, for example.

Dennis
Re: [ATL] summarising/decorating a model [message #102036 is a reply to message #101970] Tue, 17 March 2009 15:25 Go to previous message
Andy Carpenter is currently offline Andy CarpenterFriend
Messages: 145
Registered: July 2009
Senior Member
Dennis,

That worked.

thanks
Andy.

"Dennis Wagelaar" <dennis.wagelaar@vub.ac.be> wrote in message
news:gplop6$t02$1@build.eclipse.org...
> Andy Carpenter wrote:
>> I'm trying to write a transform that populates an output model
>> that summaries the input model with references back to the
>> original input model. I can produce the summary information
>> but the references that should point back to the input model
>> get transformed into references in the output model. Clearly
>> this is the correct standard behaviour. Is there a way that
>> I can actually have references from the output model
>> back to the input model?
>>
>> thanks
>> Andy.
>>
>>
>
> Since you're translating the source elements in question in the same
> transformation, they are automatically translated in each assignment
> ('<-'). Therefore, you have to avoid using '<-' for every case in which
> you don't want the automatic tracing mechanism to kick in.
>
> This can be done with the 'refSetValue(name : String, val : oclAny)'
> operation. You can use this operation in the imperative "do" section of a
> matched rule, for example.
>
> Dennis
Previous Topic:[ATL] Can not copy type of parameter
Next Topic:[ATL] about KM3 to Ecore
Goto Forum:
  


Current Time: Fri Apr 19 22:41:47 GMT 2024

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

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

Back to the top