Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] problem with primitive types when executed as Java application
[Acceleo] problem with primitive types when executed as Java application [message #902957] Tue, 21 August 2012 12:04 Go to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

As a consequence of this issue ( I have an acceleo transformation which produces the desired output only when executed as a Java Application.

I have however notice that in this case there are some problems with primitive types. suppose I have a classifier property called att typed with an Integer UML Primitive type. If I run (as a Java Application) this code

   [att.type/] []

I get

org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl@548eb (eProxyURI: pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer)

Follow me on Twitter @andreasindico

Re: [Acceleo] problem with primitive types when executed as Java application [message #904402 is a reply to message #902957] Tue, 28 August 2012 11:28 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1857
Registered: July 2009
Senior Member
Hi Andrea,

When using UML in standalone (Java Application), you need to properly register everything it needs, including the primitive types. See the UML FAQ.

The bits needed to register their models and factories can be done in your generated java launcher, within the "register*" methods.

Laurent Goubet
Re: [Acceleo] problem with primitive types when executed as Java application [message #905390 is a reply to message #904402] Thu, 30 August 2012 09:49 Go to previous message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 450
Registered: April 2010
Location: Nantes (France)
Senior Member


You should use something like this in the method registerPackages of your generator:

Map uriMap = resourceSet.getURIConverter().getURIMap();
URI uri = URI.createURI("platform:/plugin/org.eclipse.uml2.uml.resources/");
uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri.appendSegment("metamodels").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri.appendSegment("profiles").appendSegment(""));

But for the stand alone, the path of the jar org.eclipse.uml2.uml.resources is not "platform:/plugin/org.eclipse.uml2.uml.resources/" but the absolute path of the jar.


Stephane Begaudeau

Previous Topic:[Acceleo] Dynamic overriding
Next Topic:[Acceleo] Standalone problem
Goto Forum:

Current Time: Sat May 26 04:30:58 GMT 2018

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

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

Back to the top