Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3] derived metamodel - type not recognized - eProxyURI
[Acceleo 3] derived metamodel - type not recognized - eProxyURI [message #645742] Mon, 20 December 2010 06:10 Go to next message
Kirsten M. Z. is currently offline Kirsten M. Z.
Messages: 131
Registered: July 2010
Senior Member
Hello,

this is my basic generate.mtl

[comment encoding = UTF-8 /]
[module generate('http://mymodel', 'http://www.eclipse.org/uml2/3.0.0/UML')/]

[template public generate(m : uml::Model)]
	
	[comment @main /]
	[file (m.name, false, 'UTF-8')]
	[m.name/]
	[/file]
	
[/template]


You can see, that I want to work with two meta models, because mymodel is derived from the UML2 project's meta model.

This is an example model I want to load and transform:

<?xml version="1.0" encoding="ASCII"?>
<uml:Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:my="http://mymodel" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" name="ThisNameWillBecomeAFile">
  <packagedElement xsi:type="uml:PrimitiveType" name="int"/>
  <packagedElement xsi:type="my:sometype" name="derived"/>
</uml:Model>


Unfortunately, this does not work with the standard generation code Sad

The (maybe first) problem is in this code (in "doGenerate(...)"):

		// Calls the template with each potential arguments
		final EClassifier argumentType = template.getParameter().get(0).getType();
		// The input model itself is a potential argument
		if (argumentType.isInstance(model)) {
		/*...*/
		}


The "isInstance" check will never become true, so the transformation with "uml::Model" parameter is not executed.

While debugging I get:

argumentType  = org.eclipse.emf.ecore.impl.EClassImpl@17d80e9 (eProxyURI: /aml-metamodel/models/UML.ecore#//Model)

model = org.eclipse.uml2.uml.internal.impl.ModelImpl@103074e (name: ThisNameWillBecomeAFile, visibility: <unset>) (viewpoint: <unset>)

Thanks in advance!

[Updated on: Mon, 20 December 2010 06:11]

Report message to a moderator

Re: [Acceleo 3] derived metamodel - type not recognized - eProxyURI [message #645912 is a reply to message #645742] Tue, 21 December 2010 02:45 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi vultur,

We will a bit more information about your metamodel. Are you using the metamodel from the mdt uml project ? because the proxy (eProxyURI: /aml-metamodel/models/UML.ecore#//Model) seems a bit odd (aml-metamodel ?).

Stephane Begaudeau, Obeo.



Re: [Acceleo 3] derived metamodel - type not recognized - eProxyURI [message #646492 is a reply to message #645912] Sat, 25 December 2010 08:42 Go to previous message
Kirsten M. Z. is currently offline Kirsten M. Z.
Messages: 131
Registered: July 2010
Senior Member
I have created a new post: describing another issue I have (which is much more important, because it seems that a general feature is missing... and maybe this is related to other problems a have). There, you can find a complete meta model. I hope it can be used to reproduce my problems.

http://www.eclipse.org/forums/index.php?t=msg&th=202312

I still have the issues described in this threads and the following thread:

http://www.eclipse.org/forums/index.php?t=msg&th=202064

However, there are workarounds for the issue described there. Closing the project, closing other projects, re-starting Eclipse, etc. I always get it working somehow. It seems that Acceleo (and underlying technologies, of course) is not very stable here.

I really want to use Acceleo, because I had good experiences with previous work. Right now I am not happy. I have too many issues. But still... very good work, so far.

Thanks!
Previous Topic:Error on succesful jet.transform Ant task
Next Topic:[Xpand] setting the value of a global variable from xtend?
Goto Forum:
  


Current Time: Fri Aug 22 15:51:14 EDT 2014

Powered by FUDForum. Page generated in 0.07000 seconds