Bug in Flock Default Copy - Enums moved to resource [message #1856260] |
Tue, 29 November 2022 21:25  |
Eclipse User |
|
|
|
I am trying to use flock for metamodel syntax conversion (emfatic to ecore) and I believe there is a bug in the copy behaviour of flock. My understanding is that without any other instructions, flock should copy a model. I am including an example.
With this emfatic:
@namespace(
uri="http://example",
prefix="e")
package p;
enum E {
L = 0;
}
and this flock call:
<project name="project" default="copyMetamodelToEcore">
<target name="copyMetamodelToEcore">
<epsilon.emf.loadModel name="source"
modelfile="source.emf"
read="true"
store="false"
validate="true" />
<epsilon.emf.loadModel name="target"
modelfile="target.ecore"
read="false"
store="true"
validate="true" />
<epsilon.flock originalModel="source" migratedmodel="target">
<model ref="source" />
<model ref="target" />
</epsilon.flock>
</target>
</project>
When copied using flock, it looks like this. Note that the literal is not part of the package. It is a separate element in the resource. It also serialising using xmi.
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<ecore:EPackage name="p" nsURI="http://example" nsPrefix="e">
<eClassifiers xsi:type="ecore:EEnum" name="E"/>
</ecore:EPackage>
<ecore:EEnumLiteral name="L" literal="L"/>
</xmi:XMI>
When converted to ecore, it looks like this, as expected:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="p" nsURI="http://example" nsPrefix="e">
<eClassifiers xsi:type="ecore:EEnum" name="E">
<eLiterals name="L"/>
</eClassifiers>
</ecore:EPackage>
- Is this a bug?
- Can I patch around this?
[Updated on: Tue, 29 November 2022 21:29] by Moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04185 seconds