Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] how to get the type of UML attribute/property ?
[Acceleo] how to get the type of UML attribute/property ? [message #1266365] Fri, 07 March 2014 05:45 Go to next message
Joost Kraaijeveld is currently offline Joost Kraaijeveld
Messages: 173
Registered: July 2009
Senior Member
Hi,

I posted a similar/the same question yesterday but I got no response, so
I rephrase the question and hope for an answer.

I have a Papyrus model in which a class "Object" that has several
attributes with the type "String" from the UML Primitive Types, which I
imported using "import Registered Package"->"UMLPrimitiveTypes". Based
on the getting started tutorial I expected the following to work and to
result in "String attributeName":

[for (p: Property | aClass.attribute)]
[p.type.name/] [p.name/];
[/for]

But "[p.type.name/]" does not result in any output. Calling
[p.type.name.trim()/] results in an execption, i.e.
java.lang.UnsupportedOperationException: Operation trim() is undefined
on type null.

Doing the same (with and without the trim()) in the Acceleo debugger
results in "String" as expected.

Am I missing something? What should I do?

I attached my Eclipse project with all sources.

TIA


Joost
Re: [Acceleo] how to get the type of UML attribute/property ? [message #1266463 is a reply to message #1266365] Fri, 07 March 2014 08:49 Go to previous message
Joost Kraaijeveld is currently offline Joost Kraaijeveld
Messages: 173
Registered: July 2009
Senior Member
Hi,

A colleague pointed me to the run-configuration option "Runner". If I
use "Acceleo Plug-in Application (Default)" the property expansion
works, if I use "Java Application (Advanced)" it fails to work.

Reading the "Acceleo Documentation"-> "Reference" -> "Stand Alone"
explained what I should have done.

Joost
Previous Topic:[Acceleo] Any plans for MTL->Java codegen?
Next Topic:[Acceleo] how to inject manual model
Goto Forum:
  


Current Time: Tue Jul 22 05:32:48 EDT 2014

Powered by FUDForum. Page generated in 0.01709 seconds