Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Cannot access uml2 stereotype values in ATL
Cannot access uml2 stereotype values in ATL [message #26466] Fri, 30 March 2007 12:18 Go to next message
Eclipse UserFriend
Originally posted by: paul.gribben.gmail.com

Hi,

I've written an ATL transformation converting a uml2 file (created by
eclipse uml2) to an output DSL model file.

The input has some profiles applied, and these are handled correctly by
the transformation except that I don't know how to access the stereotype
properties that have been applied to via the stereotype to my model
elements. For example the UML model has stereotype 'Car' applied a to UML
type Class, and I need to get the Car 'colour' property value as applied
to a Class.

Thanks for any help.
[ATL]Re: Cannot access uml2 stereotype values in ATL [message #26620 is a reply to message #26466] Fri, 30 March 2007 14:53 Go to previous messageGo to next message
beaperez Mising name is currently offline beaperez Mising nameFriend
Messages: 81
Registered: July 2009
Member
Hello Paul,



you can try with:
yourUMLClassType.getValue(yourUMLClassType.getAppliedStereot ype('Car'),
'colour')

You can use the method getValue (yourUMLClassType.getValue(yourStereotype,
propertyName)) to get the value of a stereotype property. The method
getAppliedStereotype(String StereotypeName), is used to get the stereotype
element applied to your UML element. RegardsBea


"Paul Gribben" <paul.gribben@gmail.com> escribi
Re: [ATL]Re: Cannot access uml2 stereotype values in ATL [message #26669 is a reply to message #26620] Fri, 30 March 2007 15:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: paul.gribben.gmail.com

Thanks Bea.

I've tried your suggestion as follows but this gives a
NullPointerException at at
org.atl.engine.repositories.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:522).
My guess is that it can't resolve the value (from getValue(..)) in the EMF
model structure of the UML!Property element.

from
c : UML!Property (c.getAppliedStereotypes()->exists(s | s.name = 'Car'))

to
car: MyModel!Car(
name <- c.name,
colour <- c.getValue(c.getAppliedStereotype('Car'), 'colour')
)
Re: [ATL]Re: Cannot access uml2 stereotype values in ATL [message #26709 is a reply to message #26669] Fri, 30 March 2007 16:07 Go to previous messageGo to next message
beaperez Mising name is currently offline beaperez Mising nameFriend
Messages: 81
Registered: July 2009
Member
Have you try with the qualified name of the applied stereotype?:
colour <- c.getValue(c.getAppliedStereotype('YourProfileName::Car'),
'colour')



"Paul Gribben" <paul.gribben@gmail.com> escribi
Re: [ATL]Re: Cannot access uml2 stereotype values in ATL [message #26790 is a reply to message #26709] Fri, 30 March 2007 18:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: paul.gribben.gmail.com

Ok, I'll give that a go when I get a chance to look at this again.
Thanks
Re: [ATL]Re: Cannot access uml2 stereotype values in ATL [message #30599 is a reply to message #26709] Tue, 10 April 2007 13:43 Go to previous message
Eclipse UserFriend
Originally posted by: paul.gribben.gmail.com

Hi Bea,

Just got round to looking at this again- Your suggestion to use the fully
qualified stereotype name made it work.

Thanks for your help
Paul
Previous Topic:What can ATL?
Next Topic:Re: [ATL] adding operation
Goto Forum:
  


Current Time: Tue Mar 19 09:30:03 GMT 2024

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

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

Back to the top