Bug in code generation when referencing a metamodel from another metamodel

27 views
Skip to first unread message

Hoang Bui Vu

unread,
Jul 22, 2014, 6:03:12 PM7/22/14
to spray...@googlegroups.com
I encountered a bug while trying to create a new xcore model, which has some inheritance from classes from another xcore model through the use of its genmodel. I successfully created the new model, which seems to work fine, as I was able to create dynamic instances from it.
I proceeded to create a Spray project from the new model, and wrote some spray code to create the shapes and connections. However no matter what I tried, there would be some error markers in the src-gen folder, such as:

missing class name:

final  container = org.eclipse.xtext.EcoreUtil2.getContainerOfType(source, .class);

method undefined:

model.set((uk.man.xman.ple.model.VariantConnection) bo);

I know that the metamodel is correct, because when I tried to remove the inheritance from the other model, the spray project worked.

I suspect that the bug might come from the ecore file generation, like in these lines

<eClassifiers xsi:type="ecore:EClass" name="XmanArchitecture" eSuperTypes="../../uk.man.xman.xcore.model/model/xman.xcore#/EPackage/ComponentInstance #//FamilyConnectorTerminal #//VariationPointTerminal"/>

<eStructuralFeatures xsi:type="ecore:EReference" name="condition" lowerBound="1"
     
eType="ecore:EClass ../../uk.man.xman.xcore.model/model/xman.xcore#/EPackage/Input"
       
containment="true" resolveProxies="false"/>


these "../../", I believe they should be something else, for the spray project to recognise the path,

but I haven't figured out exactly the cause, and how to fix it yet.

Simone Di Cola

unread,
Jul 23, 2014, 1:02:00 PM7/23/14
to spray...@googlegroups.com
Hi Joerg,
 I am working with Hoang, so let me try to reformulate the question. 
Basically, we've created a model in Xcore, where we import classes from another Xcore model.  Below an extract:

 
import uk.man.xman.xcore.ComponentInstance

class XmanArchitecture extends ComponentInstance{
}


Now, when I create a new Spray project, I cannot use the XmanArchitecture spray. Simply the editor won't let me do it. 

As Hoang said, we think the problem is in the ecore meta-model. 

<eClassifiers xsi:type="ecore:EClass" name="XmanArchitecture" eSuperTypes="../../uk.man.xman.xcore.model/model/xman.xcore#/EPackage/ComponentInstance"/>

Now the questions is: does Spray deal with this case? If so, are we the only having this problem? :) 

Thanks for your attention
Simone

Simone Di Cola

unread,
Nov 8, 2014, 12:16:29 PM11/8/14
to spray...@googlegroups.com
Hi Joerg, 
 any idea with this? 

Simone

Simone Di Cola

unread,
Nov 10, 2014, 10:19:17 AM11/10/14
to spray...@googlegroups.com
Fixed. 
Reply all
Reply to author
Forward
0 new messages