Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] reference model elements of other rules
[ATL] reference model elements of other rules [message #99019] Thu, 05 February 2009 16:18 Go to next message
Michael Thiele is currently offline Michael ThieleFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,

I have a refinement transformation for 2 input and output models (with
different meta-models). One of the models has to reference a model element
of the other model that is created in the same transformation. Consider
the following example:

rule Rule1 {
from i : MM1!ModelElement1
to o : MM1!ModelElement1
(
attribute <- attribute1
),
attribute1 : MM1!ModelElement2
(
stringAttribute <- 'aString'
)
}

rule Rule2 {
from i : MM2!ModelElement2
to o : MM2!ModelElement2
(
attribute <- ??? -- should reference the model element "attribute1" of
Rule1
)
}

Is there a solution for this problem? I tried to use the resolveTemp()
function, but it did not work...


Best regards,
Michael
Re: [ATL] reference model elements of other rules [message #99035 is a reply to message #99019] Thu, 05 February 2009 17:35 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Normally you should use resolveTemp did you use like this ?

attribute <-
thisModule.resolveTemp(myHelperGettingTheElementTypedMM1!Mod elElement1,'attribute1')

becareful with your rule it matches MM1!ModelElement1 so you should get
the element in any case by a helper maybe :
MM1!ModelElement1.allInstances()->select(...)


Michael Thiele a écrit :
> Hello,
>
> I have a refinement transformation for 2 input and output models (with
> different meta-models). One of the models has to reference a model
> element of the other model that is created in the same transformation.
> Consider the following example:
>
> rule Rule1 {
> from i : MM1!ModelElement1
> to o : MM1!ModelElement1
> (
> attribute <- attribute1
> ),
> attribute1 : MM1!ModelElement2
> (
> stringAttribute <- 'aString'
> )
> }
>
> rule Rule2 {
> from i : MM2!ModelElement2
> to o : MM2!ModelElement2
> (
> attribute <- ??? -- should reference the model element "attribute1"
> of Rule1
> )
> }
>
> Is there a solution for this problem? I tried to use the resolveTemp()
> function, but it did not work...
>
>
> Best regards,
> Michael
>




Re: [ATL] reference model elements of other rules [message #99126 is a reply to message #99035] Fri, 06 February 2009 15:11 Go to previous message
Michael Thiele is currently offline Michael ThieleFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks Tristan! That's what I needed. I haven't thought of the helper to
get the MM1!ModelElement1.
Previous Topic:[ATL] Multiple output files with cross-references
Next Topic:[Announce] EMF Transform proposal
Goto Forum:
  


Current Time: Wed Sep 25 21:49:21 GMT 2024

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

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

Back to the top