Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » thisModule.resolveTemp
thisModule.resolveTemp [message #544188] Thu, 01 July 2010 23:00 Go to next message
wafaa is currently offline wafaa
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hi, Can some one explain what is the need and use for the ATL Module Operation resolveTemp.

I read the tutorial but could not get how from a matched rule, I can point to a target element and in which case i prefer to use it.

I also read example but did not get it,
packagedElement <- Set {
			s.packagedElement, 
			UML2!Class.allInstancesFrom('IN')->collect(e | thisModule.resolveTemp(e, 'extension'))

thanks in advanced

wafaa

[Updated on: Thu, 01 July 2010 23:01]

Report message to a moderator

Re: thisModule.resolveTemp [message #544255 is a reply to message #544188] Fri, 02 July 2010 07:20 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHE
Messages: 129
Registered: July 2009
Senior Member
Le 02/07/2010 01:00, wafaa a écrit :
> hi, CAn some one explains what is the need and use for the ATL Module
> Operation resolveTemp.
>
> I read the tutorial but could not get how from a matched rule, I can
> point to a target element and in which case i prefer to use it.
>
> I also read example but did not get it, packagedElement <- Set {
> s.packagedElement, UML2!Class.allInstancesFrom('IN')->collect(e |
> thisModule.resolveTemp(e, 'extension'))
> thanks in advanced
>
> wafaa
This code supposes a rule on Class where one of the output is named
'extension'

When you refer to a input Class value in the 'to' section of a rule, ATL
replace it with the corresponding output value. By default it is the
first output element of the 'to' section of corresponding rule. If you
want to refer to one of the others (the rule for Class can produce
multiple outputs) then you need to force it using resolveTemp....
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: thisModule.resolveTemp [message #544325 is a reply to message #544255] Fri, 02 July 2010 11:27 Go to previous messageGo to next message
wafaa is currently offline wafaa
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
Vincent MAHE wrote on Fri, 02 July 2010 10:20
Le 02/07/2010 01:00, wafaa a écrit :

When you refer to a input Class value in the 'to' section of a rule, ATL
replace it with the corresponding output value. By default it is the
first output element of the 'to' section of corresponding rule. If you
want to refer to one of the others (the rule for Class can produce
multiple outputs) then you need to force it using resolveTemp....



yes, i uses output element of another matched rule, not the current one? is that true,
can you give me example so that explain the replaced element and the target element

[Updated on: Fri, 02 July 2010 11:28]

Report message to a moderator

Re: thisModule.resolveTemp [message #544634 is a reply to message #544188] Mon, 05 July 2010 07:41 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 522
Registered: July 2009
Senior Member
Let's say you have that rule :

rule Class {
from s : UML!Class
to t : UML!Class(),
extension : UML!Class()
}

now you have another rule :

rule Package {
from s : UML!Package
to t : UML!Package(
packagedElement <- s.packagedElement
)
}

Now imagine a package P containing a class C.
The resulting package P' will contain C' (corresponding to 't' of the Class rule because the 'from' element is automatically and only mapped to the first 'to' element. In fact, the packagedElement <- s.packagedElement binding is equivalent to packagedElement <- s.packagedElement->collect(e | thisModule.resolveTemp(e,'t')). But the extension class won't be in the package.

If you want to also put the classes resulting from the 'extension' output pattern then you can use resolveTemp :

rule Package {
from s : UML!Package
to t : UML!Package(
packagedElement <- s.packagedElement,
packagedElement <- s.packagedElement->collect(e | thisModule.resolveTemp(e,'extension'))
)
}
Previous Topic:Increase the stack of ATL
Next Topic:[ATL] very strange behaviour with xmi:ID
Goto Forum:
  


Current Time: Wed Sep 24 00:35:41 GMT 2014

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

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