Skip to main content


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 12:23 Go to next message
Javier García is currently offline Javier GarcíaFriend
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 07: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 08:39 Go to previous messageGo to next message
Javier García is currently offline Javier GarcíaFriend
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 13:17 Go to previous message
Johan Hardy is currently offline Johan HardyFriend
Messages: 47
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: Thu Dec 26 18:02:43 GMT 2024

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

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

Back to the top