Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] How "getAppliedStereotypes()" operation works with ATL
[ATL] How "getAppliedStereotypes()" operation works with ATL [message #86485] Mon, 14 July 2008 20:30 Go to next message
Rasha is currently offline RashaFriend
Messages: 61
Registered: July 2009
Member
Hi all,

I have a question about how the "getAppliedStereotypes()" operation works
with ATL. In UML, a model element knows nothing about what stereotypes are
attached to it and the navigation goes from the stereotype to the
stereotyped element.
However in ATL rules, I can select a model element according to the
stereotype attach to it. Does ATL provide this as a build-in OCL operation?

Thanks for any help,

Rasha
Re: [ATL] How "getAppliedStereotypes()" operation works with ATL [message #86516 is a reply to message #86485] Tue, 15 July 2008 07:25 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

When using any EMF metamodel, ATL registers all the "custom" operations
which are defined in that metamodel. For instance, UML is basically an
EMF metamodel which has been extended with methods like
"getAppliedStereotypes", "getValue", "applyStereotype", etc... in order
to support of the profiles/stereotypes specification: those methods are
part of the eclipse UML2 framework.
ATL only maps method's calls to this framework.

Regards,

William

rasha a écrit :
> Hi all,
>
> I have a question about how the "getAppliedStereotypes()" operation
> works with ATL. In UML, a model element knows nothing about what
> stereotypes are attached to it and the navigation goes from the
> stereotype to the stereotyped element. However in ATL rules, I can
> select a model element according to the stereotype attach to it. Does
> ATL provide this as a build-in OCL operation?
>
> Thanks for any help,
>
> Rasha
>
Re: [ATL] How "getAppliedStereotypes()" operation works with ATL [message #86530 is a reply to message #86516] Tue, 15 July 2008 09:48 Go to previous messageGo to next message
Rasha is currently offline RashaFriend
Messages: 61
Registered: July 2009
Member
Thanks William for your fast reply.

Rasha
Re: [ATL] How "getAppliedStereotypes()" operation works with ATL [message #95977 is a reply to message #86516] Mon, 24 November 2008 13:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Stefan.Warwas.freenet.de

Hi,

could you please explain in more detail how to make these custom
operations available? I added the UML2 plug-ins to my Eclipse but when I
start the transformation, ATL always complains that it cannot find the
getAppliedStereotypes() operation. I already tried the "EMF-specific VM
only: Support UML2 stereotypes" option in the advanced tab of the run
configuration but it did not work. Moreover, I tried to switch the model
handler to UML2. Nothing worked.

Regards,

Stefan

William Piers schrieb:
> Hello,
>
> When using any EMF metamodel, ATL registers all the "custom" operations
> which are defined in that metamodel. For instance, UML is basically an
> EMF metamodel which has been extended with methods like
> "getAppliedStereotypes", "getValue", "applyStereotype", etc... in order
> to support of the profiles/stereotypes specification: those methods are
> part of the eclipse UML2 framework.
> ATL only maps method's calls to this framework.
>
> Regards,
>
> William
>
> rasha a écrit :
>> Hi all,
>>
>> I have a question about how the "getAppliedStereotypes()" operation
>> works with ATL. In UML, a model element knows nothing about what
>> stereotypes are attached to it and the navigation goes from the
>> stereotype to the stereotyped element. However in ATL rules, I can
>> select a model element according to the stereotype attach to it. Does
>> ATL provide this as a build-in OCL operation?
>>
>> Thanks for any help,
>>
>> Rasha
>>
Re: [ATL] How "getAppliedStereotypes()" operation works with ATL [message #96005 is a reply to message #95977] Mon, 24 November 2008 15:07 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
you can use get AppliedStereotypes() ending with "s" like this:


helper context UML2!Element def : isStereotypeApplied (name :String) :
Boolean =
if self.oclIsUndefined() then
false
else
not self.getAppliedStereotypes()-> select(s| s.name=name)-> isEmpty()
endif
;

this works for me!
Re: [ATL] How "getAppliedStereotypes()" operation works with ATL [message #96019 is a reply to message #96005] Tue, 25 November 2008 07:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Stefan.Warwas.freenet.de

Hello

Somehow it seems like that ATL does not find the operations implemented
by the UML2 project. How does your run configuration exactly look like?

My ATL header looks like this:

module mymodule; -- Module Template
create OUT : MM1 from IN : UML, PROFILE : UML;

What did you choose for the UML metamodel in the run configuration? Did
you check "Is metametamodel" and selected "model handler: UML2"?

Did you enable "EMF-specific VM only: Support UML2 stereotypes" at the
advanced tab? Did you changed the "ATL Virtual Machine" to "EMF-specific
VM"?

Many questions ;) Thanks for your help!

Regards,

Stefan



Skander schrieb:
> you can use get AppliedStereotypes() ending with "s" like this:
>
>
> helper context UML2!Element def : isStereotypeApplied (name :String) :
> Boolean =
> if self.oclIsUndefined() then
> false
> else
> not self.getAppliedStereotypes()-> select(s| s.name=name)-> isEmpty()
> endif
> ;
>
> this works for me!
>
Re: [ATL] How "getAppliedStereotypes()" operation works with ATL [message #96034 is a reply to message #96019] Tue, 25 November 2008 08:00 Go to previous message
Eclipse UserFriend
Originally posted by: Stefan.Warwas.freenet.de

Hi,

I just found the solution. Somehow I overlooked the "EMF Registry"
button in the run configuration ;) That is why ATL did not find the
implementation of UML2... Now, I can answer my questions on my own:

Stefan Warwas schrieb:
> Hello
>
> Somehow it seems like that ATL does not find the operations implemented
> by the UML2 project. How does your run configuration exactly look like?
>
> My ATL header looks like this:
>
> module mymodule; -- Module Template
> create OUT : MM1 from IN : UML, PROFILE : UML;

Following header is sufficient:

module mymodule; -- Module Template
create OUT : MM1 from IN : UML;

>
> What did you choose for the UML metamodel in the run configuration? Did
> you check "Is metametamodel" and selected "model handler: UML2"?

No, you don't have to check "Is metametamodel" and you don't have to
choose "model handler: UML2". Just click on the "EMF Registry..." button
and choose the UML2.1 metamodel.

>
> Did you enable "EMF-specific VM only: Support UML2 stereotypes" at the
> advanced tab? Did you changed the "ATL Virtual Machine" to "EMF-specific
> VM"?

No, you don't have to make these settings.

>
> Many questions ;) Thanks for your help!
>
> Regards,
>
> Stefan
>
>
>
> Skander schrieb:
>> you can use get AppliedStereotypes() ending with "s" like this:
>>
>>
>> helper context UML2!Element def : isStereotypeApplied (name :String) :
>> Boolean =
>> if self.oclIsUndefined() then
>> false
>> else
>> not self.getAppliedStereotypes()-> select(s| s.name=name)-> isEmpty()
>> endif
>> ;
>>
>> this works for me!
>>
Previous Topic:[ATL] problems with ATL standalone
Next Topic:[ATL] Referencing DataTypes-library elements.
Goto Forum:
  


Current Time: Thu Apr 25 20:02:40 GMT 2024

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

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

Back to the top