Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Local references replaced by non-local ones in ecore source generated from xcore
Local references replaced by non-local ones in ecore source generated from xcore [message #1630941] Mon, 23 February 2015 13:48
K M is currently offline K MFriend
Messages: 7
Registered: December 2014
Junior Member
I've got a project that uses an xcore model as a starting point and am having problems with the the .ecore source that gets built from the xcore one.
My xcore file sets the model directory to src, rather than src-gen, to allow me to alter some of the generated code.
If I delete the model.ecore source and do a clean build then the model.ecore source that gets generated looks fine.
If I then do another clean build, without first removing model.ecore, this results in a different version of the source which produces a "resource does not exist" error.

When I look at the modified ecore text I see the following:

<?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="model" nsURI="com.test.model" nsPrefix="model">
  <eClassifiers xsi:type="ecore:EClass" name="Model" abstract="true"/>
  <eClassifiers xsi:type="ecore:EClass" name="DatatypesModel" eSuperTypes="com.test.model#//Model">
    <eStructuralFeatures xsi:type="ecore:EReference" name="domains" upperBound="-1"
        eType="ecore:EClass com.test.model#//BaseDomain" containment="true" resolveProxies="false"/>
  </eClassifiers>
...

And here's what the original version looks like:

<?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="model" nsURI="com.test.model" nsPrefix="model">
  <eClassifiers xsi:type="ecore:EClass" name="Model" abstract="true"/>
  <eClassifiers xsi:type="ecore:EClass" name="DatatypesModel" eSuperTypes="#//Model">
    <eStructuralFeatures xsi:type="ecore:EReference" name="domains" upperBound="-1"
        eType="#//BaseDomain" containment="true" resolveProxies="false"/>
  </eClassifiers>
...

So the broken version has replaced local links with global ones, as you can see in the eType value. And this results in the ecore editor complaining it can't find the model resource.
Any idea why this might be happening?

Thanks
Kevin
Previous Topic:Method createSequence is exceeding the 65535 bytes limitspecialStateTransition(int s, IntStream _inp
Next Topic:Is it possible to support a wiki like DSL (like MediaWiki)?
Goto Forum:
  


Current Time: Sat Apr 20 01:46:29 GMT 2024

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

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

Back to the top