Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] summarising/decorating a model
[ATL] summarising/decorating a model [message #101786] Fri, 13 March 2009 06:51 Go to next message
Eclipse UserFriend
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 10:47 Go to previous messageGo to next message
Eclipse UserFriend
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 11:25 Go to previous message
Eclipse UserFriend
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: Mon Jul 21 20:02:42 EDT 2025

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

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

Back to the top