UML2 MetaModel not applied [message #500937] |
Mon, 30 November 2009 11:42 |
Rodrigo Tobar Messages: 5 Registered: November 2009 |
Junior Member |
|
|
Hi everyone,
I'm in the process of porting a code generator from oAW5 to the new "oAW5" suite. I've been following several blog posts here and there that have been useful in the migration of the Eclipse project and the code. Anyways, I'm facing problems with the workflow.
My workflow reads the model, checks it against a Check file, and then generates the code. It worked fine in oAW4, but now it seems to miss a namespace or something like that.
The workflow file is as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<workflow>
<property name="genPath" value="src-gen/" />
<property name="modelFile" value="my_model.uml" />
<bean class="org.eclipse.xtend.typesystem.uml2.Setup" standardUML2Setup="true"/>
<component class="org.eclipse.emf.mwe.utils.Reader" uri="${modelFile}">
<modelSlot value="model"/>
</component>
<component class="org.eclipse.xtend.check.CheckComponent">
<metaModel id="mm" class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
<checkFile value="constraints"/>
<emfAllChildrenSlot value="model"/>
</component>
<component id="dirCleaner"
class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="src-gen"/>
<component id="gen" class="org.eclipse.xpand2.Generator" skipOnErrors="true">
<metaModel idRef="mm" />
<genPath value="${genPath}"/>
<expand value="templates::Root::Root FOR model"/>
<beautifier class="org.eclipse.xpand2.output.JavaBeautifier"/>
</component>
</workflow>
In my template, I have the following:
«IMPORT uml»
«DEFINE Root FOR uml::Model»
«EXPAND FSMJava::Root FOREACH allOwnedElements().typeSelect(uml::StateMachine)»
«ENDDEFINE»
and the error that I get is the following:
Nov 30, 2009 12:21:28 PM org.eclipse.emf.mwe.core.container.CompositeComponent internalInvoke
INFO: Generator(gen): generating 'templates::Root::Root FOR model' => []
Nov 30, 2009 12:21:28 PM org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent invokeInternal
SEVERE: Error in Component gen of type org.eclipse.xpand2.Generator:
EvaluationException : No Definition 'templates::Root::Root for null::Model' found!
[23,38] on line 1 'EXPAND templates::Root::Root FOR model'
Nov 30, 2009 12:21:28 PM org.eclipse.emf.mwe.core.WorkflowRunner executeWorkflow
SEVERE: Workflow interrupted. Reason: No Definition 'templates::Root::Root for null::Model' found!
Nov 30, 2009 12:21:28 PM org.eclipse.emf.mwe.core.WorkflowRunner logIssues
SEVERE: [ERROR]: No Definition 'templates::Root::Root for null::Model' found!(Element: EXPAND templates::Root::Root FOR model; Reported by: Generator(gen): generating 'templates::Root::Root FOR model' => [])
From what I get, the workflow is considering the "mode" variable as of "null::Model" type, when it should be of "uml::Model" type. I'm using the UML2MetaModel in the generator and in the checks, but it doesn't work anyways.
Any hints about what could be the problem here? From now, I'm highly grateful for any replies to my problem.
Cheers!
|
|
|
Re: UML2 MetaModel not applied [message #500964 is a reply to message #500937] |
Mon, 30 November 2009 13:49 |
|
Don't you have any profile for your model? Usually one would not use the UML2MetaModel bare bone, but typically the ProfileMetaModel. Anyway, maybe it is just a bug. Could you define a dummy profile and try again with a ProfileMetaModel (don't forget to use a platform:/resource URI for the profile, same for your model path).
If the problem disappears then could you be so kind and open a bug report?
Kind regards,
~Karsten
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03649 seconds