Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » EType reference of EReference serialization problem(EReferences to local EClasses get the full "external" model path when written.)
EType reference of EReference serialization problem [message #528639] Wed, 21 April 2010 06:56 Go to next message
Eclipse UserFriend
The EType reference of EReferences to the owned EClasses of an Ecore model we generate with Xtend/MWE do not look right in the serialized .ecore file:

<eStructuralFeatures xsi:type="ecore:EReference" name="viAssignFields" eType="ecore:EClass ../Proto.druid.konto/src-gen/HicPackages.ecore#//Root_Assign Fields " containment="true"/>

For the EType reference I would have expected eType="#//Root_AssignFields". Any ideas what we might be doing wrong?


Workflow snippet:

...
<property name="modelFile" value=" ../../runtime-EclipseApplication/org.example.FilterHic/HicFi lter.filter "/>
<property name='modelFileTransformed' value='../Proto.druid.konto/src-gen/HicPackages.ecore'/>

...
<component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
<!-- this class will be generated by the xtext generator -->
<register class="org.example.druid.filter.FilterDslStandaloneSetup"/ >
<validate value="${validateModel}"/>
<outputSlot value="theModel" />
</component>

<component class="org.eclipse.xtend.XtendComponent">
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
<metaModel class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
<invoke value="templates::FilterTransform::main(theModel)" />
<outputSlot value="theModelTransformed" />
</component>

<component class="org.eclipse.emf.mwe.utils.Writer">
<useSingleGlobalResourceSet value="true"/>
<uri value="${modelFileTransformed}" />
<modelSlot value="theModelTransformed" />
</component>
...


Xtend snippet:

...
ecore::EReference newEReference( filterDsl::Section section, String prefix):

let nextClass = newEClass(section.target.targetType, section.succ, prefix):
let eReference = new EReference :
eReference.setEType(nextClass) ->
...
-> eReference
;

ecore::EClass newEClass( filterDsl::FilteredMetaType type, filterDsl::Successor succ, String prefix):

let eClass = new EClass :
let nameAttr = new EAttribute :
nameAttr.setName("name") ->
...
-> eClass
;
...

Versions:

Xtext 0.8.0.v200909291551
Xtend 0.8.0.v200909291301

[Updated on: Wed, 21 April 2010 07:01] by Moderator

Re: EType reference of EReference serialization problem [message #528734 is a reply to message #528639] Wed, 21 April 2010 11:04 Go to previous messageGo to next message
Eclipse UserFriend
Germund,

Comments below.

germund wrote:
> The EType reference of EReferences to the owned EClasses of an Ecore
> model we generate with Xtend/MWE do not look right in the serialized
> .ecore file:
>
> <eStructuralFeatures xsi:type="ecore:EReference" name="viAssignFields"
> eType="ecore:EClass
> ../Proto.druid.konto/src-gen/HicPackages.ecore#//Root_Assign Fields "
> containment="true"/>
>
> For the EType reference I would have expected
> eType="#//Root_AssignFields". Any ideas what we might be doing wrong?
>
>
> Workflow snippet:
>
> ..
> <property name="modelFile" value="
> ../../runtime-EclipseApplication/org.example.FilterHic/HicFi
> lter.filter "/>
One would hope that a relative path like this would be resolve into an
absolute path before it's used to open the Ecore resource, but given
what you show above, I'd say it's not the case. I'd open a bugzilla.
> <property name='modelFileTransformed'
> value='../Proto.druid.konto/src-gen/HicPackages.ecore'/>
>
> ..
> <component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
> <!-- this class will be generated by the xtext generator -->
> <register
> class="org.example.druid.filter.FilterDslStandaloneSetup"/ >
> <validate value="${validateModel}"/>
> <outputSlot value="theModel" />
> </component>
>
> <component class="org.eclipse.xtend.XtendComponent">
> <metaModel
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
> <metaModel class="
> org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
> <invoke value="templates::FilterTransform::main(theModel)" />
> <outputSlot value="theModelTransformed" />
> </component>
>
> <component class="org.eclipse.emf.mwe.utils.Writer">
> <useSingleGlobalResourceSet value="true"/>
> <uri value="${modelFileTransformed}" />
> <modelSlot value="theModelTransformed" />
> </component>
> ..
>
>
> Xtend snippet:
>
> ..
> ecore::EReference newEReference( filterDsl::Section section, String
> prefix):
>
> let nextClass = newEClass(section.target.targetType, section.succ,
> prefix):
> let eReference = new EReference :
> eReference.setEType(nextClass) ->
> ...
> -> eReference
> ;
>
> ecore::EClass newEClass( filterDsl::FilteredMetaType type,
> filterDsl::Successor succ, String prefix):
>
> let eClass = new EClass :
> let nameAttr = new EAttribute :
> nameAttr.setName("name") ->
> ...
> -> eClass
> ;
> ..
Re: EType reference of EReference serialization problem [message #528886 is a reply to message #528734] Thu, 22 April 2010 05:58 Go to previous message
Eclipse UserFriend
Thanks. Filed Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=310077.
Previous Topic:[ATL] UML2OWL build.xml does not run as ant build
Next Topic:Announcement: Ecore2GenModel Case at Transformation Tool Contest 2010
Goto Forum:
  


Current Time: Wed Jul 23 23:36:32 EDT 2025

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

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

Back to the top