[Acceleo 3] derived metamodel - type not recognized - eProxyURI [message #645742] |
Mon, 20 December 2010 11:10 |
Kirsten M. Z. Messages: 132 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
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 11:11] Report message to a moderator
|
|
|
|
Re: [Acceleo 3] derived metamodel - type not recognized - eProxyURI [message #646492 is a reply to message #645912] |
Sat, 25 December 2010 13:42 |
Kirsten M. Z. Messages: 132 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!
|
|
|
Powered by
FUDForum. Page generated in 0.03503 seconds