UML2 MetaModel not applied [message #500937] |
Mon, 30 November 2009 06:42  |
Eclipse User |
|
|
|
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 #501915 is a reply to message #500987] |
Fri, 04 December 2009 08:15  |
Eclipse User |
|
|
|
Andre Albert wrote on Mon, 30 November 2009 10:28 | I have a similar question..
Do you run it stand-alone?
I do also have problems while migrating from oaw4 to eclipse.xpand having a standalone (Ant) environment outside of eclipse.
Is platform:/resource usable standalone?
|
Dear,
I'm now in the same problem that you describe. I was able to apply the profiles, generate code and all, but since the ProfileMetaModel must be used with the platform:/resource URI protocol, I cannot run it stand-alone.
Is there a workaround for this? or maybe I'm just getting the concept wrong?
Thanks in advance,
Rodrigo
|
|
|
Powered by
FUDForum. Page generated in 0.04005 seconds