Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » thisModule.resolveTemp
thisModule.resolveTemp [message #544188] Thu, 01 July 2010 19:00 Go to next message
Eclipse UserFriend
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 19:01] by Moderator

Re: thisModule.resolveTemp [message #544255 is a reply to message #544188] Fri, 02 July 2010 03:20 Go to previous messageGo to next message
Eclipse UserFriend
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 07:27 Go to previous messageGo to next message
Eclipse UserFriend
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 07:28] by Moderator

Re: thisModule.resolveTemp [message #544634 is a reply to message #544188] Mon, 05 July 2010 03:41 Go to previous message
Eclipse UserFriend
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: Mon Jun 23 12:29:36 EDT 2025

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

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

Back to the top