Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » GetAppliedStereotypes for Class in UML using ATL
GetAppliedStereotypes for Class in UML using ATL [message #649881] Thu, 20 January 2011 20:19 Go to next message
Ola Missing name is currently offline Ola Missing nameFriend
Messages: 9
Registered: January 2011
Junior Member
Hi,

Could anyone help me to find the method that gets the applied stereotypes on a uml class using ATL. I tried this but it is not working:

helper context uml!class def: isStereotypeApplied() : Boolean =
(not self.getRequiredStereotype('ProfileName:StereotypeName').ocl IsUndefined());

Any help is appreciated

Thanks, Ola
Re: GetAppliedStereotypes for Class in UML using ATL [message #649956 is a reply to message #649881] Fri, 21 January 2011 08:28 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
There are a few ways of doing this. In fact the method you use isn't correct as it only checks if a stereotype is required to be applied, often this is not the case. Try this one...

not self.getAppliedStereotype('PROFILE NAME::StereotypeName').oclIsUndefined()

Make sure you set the values for PROFILE NAME and StereotypeName correctly

Regards,
Ronan
Re: GetAppliedStereotypes for Class in UML using ATL [message #650036 is a reply to message #649956] Fri, 21 January 2011 14:13 Go to previous messageGo to next message
Ola Missing name is currently offline Ola Missing nameFriend
Messages: 9
Registered: January 2011
Junior Member
Ronan,

Thank you for your reply.

I also tried this and it does not work. It seems to me that "getAppliedStereotype" does not work on a uml "Class". It only works for an "Element". What do you think?

Thanks, Ola
Re: GetAppliedStereotypes for Class in UML using ATL [message #650045 is a reply to message #649881] Fri, 21 January 2011 14:28 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Each UML2 EClasses inherit from Element.
Re: GetAppliedStereotypes for Class in UML using ATL [message #650048 is a reply to message #650045] Fri, 21 January 2011 14:36 Go to previous messageGo to next message
Ola Missing name is currently offline Ola Missing nameFriend
Messages: 9
Registered: January 2011
Junior Member
do u have a reason, why this operation is not working right?

thanks
Re: GetAppliedStereotypes for Class in UML using ATL [message #650086 is a reply to message #650048] Fri, 21 January 2011 16:51 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
It isn't working probably because you aren't doing one of the following:
1) Using a valid UML Profile or Input Model
2) Not passing in a valid Element into your helper e.g. Class or Property are both good
3) Your not constructing the call properly. Are you sure you have 2 colons i.e. PROFILE NAME::StereotypeName
Regards,
Ronan
Re: GetAppliedStereotypes for Class in UML using ATL [message #650101 is a reply to message #650086] Fri, 21 January 2011 17:57 Go to previous messageGo to next message
Ola Missing name is currently offline Ola Missing nameFriend
Messages: 9
Registered: January 2011
Junior Member
Ronan,
Is there anything to do with the uppercase of PROFILE NAME?
Thanks, Ola
Re: GetAppliedStereotypes for Class in UML using ATL [message #650104 is a reply to message #650101] Fri, 21 January 2011 18:25 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
The PROFILE NAME must be the same as what you called the profile. To see what your profile is named call getAllAppliedProfiles() on your UML model. Each Profile returned will have a name property. Use that to see what you should pass in.
Regards,
Ronan
Re: GetAppliedStereotypes for Class in UML using ATL [message #650134 is a reply to message #650104] Fri, 21 January 2011 21:17 Go to previous message
Ola Missing name is currently offline Ola Missing nameFriend
Messages: 9
Registered: January 2011
Junior Member
No Message Body
Previous Topic:[QVTo] USe of profile in target model
Next Topic:[ATL] UML Component with stereotypes issue
Goto Forum:
  


Current Time: Tue Apr 16 21:47:51 GMT 2024

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

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

Back to the top