problem running xpand generator [message #63404] |
Wed, 01 July 2009 14:48 |
Bill Hinge Messages: 156 Registered: July 2009 |
Senior Member |
|
|
Hi
I'm struggling through some workflow & xpand2 issues and I've got as far
as the generator part.
I have set up my gmf model in $model etc for my Reader and it is being
read but I'm getting a fatal error at the generator.
My xpand template is quite simple at this stage
«IMPORT ngoss»
«IMPORT contract»
«IMPORT sla»
«DEFINE ngoss FOR contract::Contract»
«ENDDEFINE»
Note, even though I used code completion I'm getting those red error
marks on my IMPORT's
Here is part of my workflow
<component class="org.eclipse.emf.mwe.utils.Reader">
<firstElementOnly value="false" />
<modelSlot value="model"/>
<uri value="${model}"/>
</component>
<component class="org.eclipse.xpand2.Generator" id="generate">
<metaModel id="mm"
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
<fileEncoding value="UTF-8"/>
<expand value="Demos::ngoss FOR model" />
<outlet path="${src-gen}"/>
</component>
Note it doesn't seem to matter if I use templates::Demos or not!
Jul 1, 2009 3:17:40 PM
org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflo wComponent
invokeInternal
SEVERE: Error in Component generate of type org.eclipse.xpand2.Generator:
EvaluationException : No Definition 'templates::NewTemplateFile::ngoss
for List' found!
[23,50] on line 1 'EXPAND templates::NewTemplateFile::ngoss FOR model'
Jul 1, 2009 3:17:40 PM org.eclipse.emf.mwe.core.WorkflowRunner
executeWorkflow
SEVERE: Workflow interrupted. Reason: No Definition
'templates::NewTemplateFile::ngoss for List' found!
Jul 1, 2009 3:17:40 PM org.eclipse.emf.mwe.core.WorkflowRunner logIssues
SEVERE: [ERROR]: No Definition 'templates::NewTemplateFile::ngoss for
List' found!(Element: EXPAND templates::NewTemplateFile::ngoss FOR
model; Reported by: Generator(generate): generating
'templates::NewTemplateFile::ngoss FOR model' => ..//com.xx.yyy.ui/src-gen)
I'm using Galileo with xpand 0.7 on OS X (hence the encoding set up!)
regards
Steve
|
|
|
|
|
Re: problem running xpand generator - dual root? [message #63520 is a reply to message #63474] |
Thu, 02 July 2009 11:40 |
Bill Hinge Messages: 156 Registered: July 2009 |
Senior Member |
|
|
Sorry to be a pain ;-)
I was a bit hasty last night, it was late and I was testing against
an old model file.
While this does work and start the generator I now notice something
strange.
My new model file contains 2 roots, a model root and a diagram root.
(I'm using a shared GEF-GMF editing domain)
If I test against this then I get the following error
SEVERE: [ERROR]: No Definition 'Demos::Main for notation::Diagram' found!
Thinking literally, this is from the GMF runtime (notation.ecore)
so if I put
«IMPORT contract»
«IMPORT informationModel»
«IMPORT ecore»
«IMPORT sla»
«IMPORT uml»
«IMPORT sbvr»
«IMPORT ngoss»
«IMPORT tam»
«DEFINE Main FOR contract::BusinessService»
«ENDDEFINE»
«DEFINE Main FOR notation::Diagram»
«ENDDEFINE»
It completes as before, however, if I try to put any kind
of function in - even creation of a file then it just stalls
and terminates
«IMPORT contract»
«IMPORT informationModel»
«IMPORT ecore»
«IMPORT sla»
«IMPORT uml»
«IMPORT sbvr»
«IMPORT ngoss»
«IMPORT tam»
«DEFINE Main FOR contract::BusinessService»
«FILE "myTestFile.txt" »
teststuff
«ENDFILE»
«ENDDEFINE»
«DEFINE Main FOR notation::Diagram»
«ENDDEFINE»
INFO: Generator(ngossGenerate): generating 'Demos::Main FOREACH
ngossModel' => ./src-gen
regards
Steve
PS fixed the red errors, thanks
Bill Hinge wrote:
> Thank You very much Krzystof
>
> I was actually just about to do some emf/gmf remodeling thinking
> I'd made an error when I read your post! It's been driving me mad
> all day
>
> It worked ;-)
>
> thanks again
> Steve
>
>
> Krzysztof Kowalczyk wrote:
>> The problem is described explicitly:
>> > No Definition 'templates::NewTemplateFile::ngoss for List' found!
>>
>> So it seems that you have list in your model slot. But you created a
>> template for contract::Contract not for List[contract::Contract]. You
>> don't have to change the template. To handle a list you can just
>> change the following:
>>
>> <expand value="Demos::ngoss FOREACH model" />
>>
>> (notice the FOREACH to handle collections), and it should work.
>>
>> > Note, even though I used code completion I'm getting those red error
>> > marks on my IMPORT's
>>
>> I don't understand your problem, but it sounds like a problem with
>> metamodel visibility in editor, or missing metamodel contributor
>> (Window -> Preferences - >Xtend/Xpand).
>>
>> Regards,
>> Krzysztof Kowalczyk
|
|
|
Powered by
FUDForum. Page generated in 0.18679 seconds