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 type of UML attribute/property ?
[Acceleo] how to get the type of UML attribute/property ? [message #1266365] Fri, 07 March 2014 10:45 Go to next message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
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


Cheers,

Joost
Re: [Acceleo] how to get the type of UML attribute/property ? [message #1266463 is a reply to message #1266365] Fri, 07 March 2014 13:49 Go to previous message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
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


Cheers,

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


Current Time: Fri Apr 19 23:13:17 GMT 2024

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

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

Back to the top