Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Reference output model elements
[ATL] Reference output model elements [message #70446] Fri, 04 January 2008 10:38 Go to next message
Eclipse UserFriend
Originally posted by: lkelly.yahoo.com

Hi,

Can anyone tell me is it possible to reference elements of the output
model during an ATL transformation?

Lisa
Re: [ATL] Reference output model elements [message #70486 is a reply to message #70446] Fri, 04 January 2008 11:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

This is a multi-part message in MIME format.
--------------000603070607030402060709
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Lisa,

Yes you can. Output elements are given a name. You can use it as a
reference to the create object (but only in the rule defining it).

Happy new year,
Quentin

Lisa Kelly a
Re: [ATL] Reference output model elements [message #70651 is a reply to message #70486] Mon, 07 January 2008 06:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lkelly.yahoo.com

Hi Quentin,

Thank you so much for your answer, the only problem is that I want to
reference an output element from a rule that doesnt create the object. Is
there any way of doing this that you know of?

Thank you and Happy New Year to you too,
Lisa

Quentin Glineur wrote:

> Hi Lisa,

> Yes you can. Output elements are given a name. You can use it as a
> reference to the create object (but only in the rule defining it).

> Happy new year,
> Quentin

> Lisa Kelly a écrit :
>> Hi,
>>
>> Can anyone tell me is it possible to reference elements of the output
>> model during an ATL transformation?
>>
>> Lisa
>>
Re: [ATL] Reference output model elements [message #70666 is a reply to message #70651] Mon, 07 January 2008 06:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi Stefanie, you have to import the profile as metamodel if you want to
apply some stereotype to your output elements.

This is the header of a sample transformation from profile A to profile B:

module moduleName;
create OUT : UML2 from IN : UML2, PRO : UML2;

IN and OUT are the UML2 metamodel and PRO is the .uml definition of
profile B.

The following is a rule that matches a stereotyped UML Component and
generates a stereotyped UML Class:

rule comp2class{
from
s : UML2!Component
(
s.isStereotypeApplied('<stereotypeName>')
)
to
t : UML2!Class(
-- bindings
)
do {
t.applyStereotype(<here you put the Stereotype definition contained in
PRO>);
t.setValue(<Stereotype definition contained in PRO>, '<propertyName>',
<propertyValue>);
}
}

helper context UML2!Element def: isStereotypeApplied(name : String) :
Boolean =
not self.getAppliedStereotypes()->select(p |
p.name = name
).isEmpty();

This is how I tackled the problem of applying stereotypes to UML elements
and set the values of UML Tagged values.

I hope this will be useful, regards

Ivano

stefanie zhao wrote:

> Hi, Thanks very much, it's really helpful.

> But I have another question, can I set the stereotype properties, just
> in the same procedure as i set the basic properties of this element. I
> need to set some properties defined in the stereotype to refine my PIM
> to get a PSM.

> Should I import the profile as a metamodel?

> Thanks again.



> Tristan FAURE 写道:
>> Hi !
>> when you match you match your element in an ATL rule you can add some
>> condition example
>> from o : UML!Operation(myCondition)
>> and it exists the function getAppliedStereotypes()
>> you can do getAppliedStereotypes()->select(s | s.name = "Invoke")
>>
>>
>>
Re: [ATL] Reference output model elements [message #70708 is a reply to message #70651] Mon, 07 January 2008 10:18 Go to previous message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

This is a multi-part message in MIME format.
--------------090008050402010007030803
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Lisa,

OK! So, in ATL, you assign a reference of an output object with an input
object. This last will be replaced by a reference to the object created
from it.

Therefore, you do not handle directly the references but rather let them
to ATL.

I hope this meets your question.

Quentin

Lisa Kelly a
Previous Topic:[ATL] (EMF?) engine cannot find existing reference
Next Topic:[ATL] performance tips
Goto Forum:
  


Current Time: Sat May 10 09:14:06 EDT 2025

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

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

Back to the top