Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [mwe] Use of the property multipleResourcesInCaseOfList of the mwe writer
[mwe] Use of the property multipleResourcesInCaseOfList of the mwe writer [message #623091] Thu, 29 July 2010 08:40 Go to next message
christiancihFriend
Messages: 5
Registered: May 2010
Junior Member
Hello,

I have a transformation workflow. At the end I want to write my transformed models into resources.


<component class="org.eclipse.xtend.XtendComponent">
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelFile value="${metamodel_1}" />
</metaModel>
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelFile value="${metamodel_2}" />
</metaModel>

<invoke value="src-gen::xtend::transformation::main(model)" />
<outputSlot value="transformedModel"/>
</component>

<component class="org.eclipse.emf.mwe.utils.Writer">
<multipleResourcesInCaseOfList value="true" />
<modelSlot value="transformedModel" />
<uri value="${output}/model.xmi" />
</component>


For one single model, it works very well. The writer has the property multipleResourcesInCaseOfList, but when I give over a List of models there is always an error message. I thought the writer will automatically write every model in seperate files.

So my question is, how to use the component Writer with this property. And how do I have to set the uri value in case of multiple output models?

Greetings
Chris
Re: [mwe] Use of the property multipleResourcesInCaseOfList of the mwe writer [message #623093 is a reply to message #623091] Fri, 30 July 2010 13:49 Go to previous message
christiancihFriend
Messages: 5
Registered: May 2010
Junior Member
I watched in the source code of the class org.eclipse.emf.mwe.utils.Writer and there is a function called getName which wants to create a filename for each incoming EObject.

private String getName(final EObject model) {
return (String) model.eGet(model.eClass().getEStructuralFeature("name"));
}


I don't know why, but the programmer thought maybe, that the eClass of the EObject always has a EStructuralFeature "name".
This is a mistake!

So I think I will write the output models with the help of own java code.

Greetings!
Previous Topic:[EEF] DateTime Widget.
Next Topic:[EMFatic] Help with ExtendedAnnotations, Regular Expressions and constrained values.
Goto Forum:
  


Current Time: Fri Apr 19 23:28:46 GMT 2024

Powered by FUDForum. Page generated in 0.03340 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top