Setup Xpand workflow: No Definition 'MyTemplate::main ...' found! [message #777597] |
Tue, 10 January 2012 19:43 |
Julian Lettner Messages: 2 Registered: January 2012 |
Junior Member |
|
|
Hello!
I am trying to set up an Xpand workflow but the following exception is raised instead.
0 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component of type org.eclipse.xpand2.Generator:
EvaluationException : No Definition 'MyTemplate::main for pointPath::Model' found!
[23,35] on line 1 'EXPAND MyTemplate::main FOREACH xxx'
0 ERROR Mwe2Launcher - Problems running workflow blub: No Definition 'MyTemplate::main for pointPath::Model' found!
java.lang.RuntimeException: Problems running workflow blub: No Definition 'MyTemplate::main for pointPath::Model' found!
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:99)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: org.eclipse.emf.mwe.core.WorkflowInterruptedException: No Definition 'MyTemplate::main for pointPath::Model' found!
at org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent.invokeInternal(AbstractExpressionsUsingWorkflowComponent.java:247)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:97)
... 5 more
I reduced my setup to the following files (paths are relative from workspace root '/'), but the problem still persists.
(Assume that I am stupid and don't know anything.)
[/CodeGenerators/src/blub.mwe2]
module blub
Workflow {
component = org.eclipse.xtext.mwe.Reader {
path = "../LegoExamples/input"
register = tue.glt.lego.points.PointPathStandaloneSetup {}
load = {
slot = "xxx"
type = "Model"
}
}
component = org.eclipse.xpand2.Generator {
metaModel = org.eclipse.xtend.typesystem.emf.EmfMetaModel {
metaModelPackage = "tue.glt.lego.points.pointPath.PointPathPackage"
}
expand = "MyTemplate::main FOREACH xxx"
outlet = {
path = "../LegoExamples/output"
}
}
}
[/CodeGenerators/src/MyTemplate.xpt]
«IMPORT tue::glt::lego::points::pointPath»
«DEFINE main FOR Model»
«ENDDEFINE»
[/DslProject/src/tue/glt/lego/points/PointPath.xtext]
grammar tue.glt.lego.points.PointPath with org.eclipse.xtext.common.Terminals
generate pointPath "h t t p ://www.glt.tue/lego/points/PointPath" // (cannot post links)
Model:
name = ID
;
I would really appreciate your help because I am fighting this for almost a whole day now (Google was not much help either) and getting quite desperate.
Thanks for your time!
[Updated on: Tue, 10 January 2012 19:44] Report message to a moderator
|
|
|
|
|
|
|
Re: Setup Xpand workflow: No Definition 'MyTemplate::main ...' found! [message #780636 is a reply to message #780631] |
Wed, 18 January 2012 20:32 |
Edin - Messages: 7 Registered: January 2012 |
Junior Member |
|
|
Hi Christian,
Thank you for your very fast reply!
This is the problem
0 INFO AbstractExpressionsUsingWorkflowComponent - No meta models configured, using JavaBeans as default.
165 WARN SlotEntry - Could not find any exported element of type 'Model' -> Slot 'someslot' is empty.
248 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component of type org.eclipse.xpand2.Generator:
EvaluationException : No Definition 'templates::commands2txtnxt::generateFile for List' found!
[23,60] on line 1 'EXPAND templates::commands2txtnxt::generateFile FOR someslot'
248 ERROR Mwe2Launcher - Problems running workflow run: No Definition 'templates::commands2txtnxt::generateFile for List' found!
java.lang.RuntimeException: Problems running workflow run: No Definition 'templates::commands2txtnxt::generateFile for List' found!
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:99)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: org.eclipse.emf.mwe.core.WorkflowInterruptedException: No Definition 'templates::commands2txtnxt::generateFile for List' found!
at org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent.invokeInternal(AbstractExpressionsUsingWorkflowComponent.java:247)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:97)
... 5 more
My workflow file:
module run
import org.eclipse.emf.mwe.utils
var inputDir = "src/instances"
var targetDir = "src/output"
Workflow {
component = org.eclipse.xtext.mwe.Reader {
path = inputDir
register = org.xtext.CommandsStandaloneSetup {}
load = {
slot = "someslot"
type = "Model"
name = "outputa"
}
}
component = org.eclipse.xpand2.Generator {
expand = "templates::commands2txtnxt::generateFile FOR someslot"
outlet = {
path = targetDir
}
}
}
and this is my template
«IMPORT org::xtext::commands»
«DEFINE generateFile FOR Model»
«ENDDEFINE»
Very basic stuff, but I have no idea how to fix this. I have exported the xtext as a plugin, so the import in the template file is ok.
[Updated on: Wed, 18 January 2012 20:33] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Setup Xpand workflow: No Definition 'MyTemplate::main ...' found! [message #869952 is a reply to message #869940] |
Sat, 05 May 2012 05:03 |
|
Hi,
i am confused by your question. could yoiu please explain step by step what you are actually doing in you usecase.
here is what i asumed
(1) you have a Xtext project that defines a Lf Language (please share you grammar)
(2) there Language defines a Concept "BINDING"
(3) you have some of these .yourdsl file lying arround and want to generate code from them
(4) you create the MyQNP class somewhere in yourdsls runtime project
(5) you adapt the existing runtime module class in your dsls runtime project and add the binding there
P.S: which Xtext Version do you use?
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Setup Xpand workflow: No Definition 'MyTemplate::main ...' found! [message #870001 is a reply to message #870000] |
Sat, 05 May 2012 15:48 |
|
And:
i do the following
(1) create a new xtext project using the wizard
(2) paste your grammar
(3) Generate the language
(4) adapt the workflow in the generator project
(5) drop following Example.mydsl file into the src/model dir
<definitions name="test" targetNamespace="test">
<binding name="test" type="test" >
<soap:binding style="style" transport="test"
/>
<operation name="test" >
<soap:operation soapAction="test" />
<input>
<soap:body use="test" encodingStyle="test"
/>
</input>
<output>
<soap:body use="test"
encodingStyle="test"
/>
</output>
</operation>
</binding>
</definitions>
(6) run the workflow.
an hey: it works without any complaints
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Sat, 05 May 2012 15:49] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Setup Xpand workflow: No Definition 'MyTemplate::main ...' found! [message #870342 is a reply to message #870245] |
Mon, 07 May 2012 17:24 |
|
Hi,
it works like a charm. as output i get this nice xmi file
<?xml version="1.0" encoding="ASCII"?>
<test:BINDING xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:test="http://www.xtext.org/Test" xsi:schemaLocation="http://www.xtext.org/Test java://org.xtext.test.TestPackage" name="'test'" type="'test'" style="'style'" transport="'test'" operation="'test'" body="'test'" encoding="'test'" use="'test'" encodingStyle="'test'">
<soapoperation soap="'test'"/>
</test:BINDING>
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|