Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] How to get the value of a property (tagged value)(I want to get the value, right now I can only get the name)
icon7.gif  [Acceleo] How to get the value of a property (tagged value) [message #1095710] Tue, 27 August 2013 08:23 Go to next message
Javier García is currently offline Javier García
Messages: 129
Registered: April 2013
Senior Member
Hi everyone,
I have an UML model with a profile applied, one of the elements has an Stereotype applied called Workbench. There is another stereotype called Perspective.
So Workbench has a property(tagged value)referencing elements with the stereotype Perspective.
The problem for me is that this property is a Set of elements, so when I try to get this property I get the Set, but what I would like to do is get the elements contained in the set.
Is this possible?And if so, how could I do this?

I have tried several different things and I can't find a way, but I know that in the model the elements are linked, so I hope there is a way to get these elements.
Let me know if there's anything else you need to know.

Thanks in advance,
regards,
Javier

[Updated on: Wed, 28 August 2013 03:57]

Report message to a moderator

Re: [Acceleo] How to get the value of a property (tagged value) [message #1096327 is a reply to message #1095710] Wed, 28 August 2013 04:39 Go to previous messageGo to next message
Javier García is currently offline Javier García
Messages: 129
Registered: April 2013
Senior Member
This is what I get if I use getValue(Stereotype, propertyName)
org.eclipse.emf.ecore.impl.DynamicEObjectImpl@526fde (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1a48415 (name: Perspective) (instanceClassName: null) (abstract: false, interface: false))

I've tried several combinations and I don't know how to do it.
I also tried a java service, but it didn't work either so I don't really know what else to try.
Re: [Acceleo] How to get the value of a property (tagged value) [message #1096494 is a reply to message #1096327] Wed, 28 August 2013 09:17 Go to previous message
Johan Hardy is currently offline Johan Hardy
Messages: 32
Registered: December 2012
Member
The following works on my side:

[query public getPointerKind(p : uml::Parameter) : String =  p.getValue(p.getAppliedStereotype('functional_C::Pointer'), 'Pointer').oclAsType(uml::EnumerationLiteral).name
/]


This is an example in C with UML. The stereotype is applied on a function parameter and the query returns '**' or '*'.
Previous Topic:[Acceleo] Target folder outside workspace in absolute path
Next Topic:[Acceleo] Warning in query implemented in Java
Goto Forum:
  


Current Time: Sat Aug 23 01:39:36 EDT 2014

Powered by FUDForum. Page generated in 0.02147 seconds