Cannot access uml2 stereotype values in ATL [message #26466] |
Fri, 30 March 2007 12:18 |
Eclipse User |
|
|
|
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.
|
|
|
|
Re: [ATL]Re: Cannot access uml2 stereotype values in ATL [message #26669 is a reply to message #26620] |
Fri, 30 March 2007 15:05 |
Eclipse User |
|
|
|
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')
)
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02289 seconds