Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [XPand2] Unknown type 'ecore::EClass'
[XPand2] Unknown type 'ecore::EClass' [message #662869] Fri, 01 April 2011 06:14 Go to next message
Christopher Gerking is currently offline Christopher Gerking
Messages: 39
Registered: April 2011
Member
I'd like to transform EMF models to text. The special thing about my meta-model is that it contains references to the Ecore meta-model itself. Hence, it is not only an instance of Ecore, but in addition, has references to parts of Ecore. More precisely, an EClass in my meta-model has a reference to EClassifier.

Within my XPand template, I want to access the EClassifier via the respective reference from my meta-model. Since I am only interested in EClasses among the EClassifiers, I perform the appropriate typeSelect.

I have ne errors marked in the template, but on execution I get the following error message: Unknown type 'ecore::EClass'

This is a simplified version of my template. "Base" is an EClass of my meta-model which indirectly references "EClassifier".

«IMPORT xyz»

«DEFINE main FOR Base»
«EXPAND sub FOREACH this.baseref.ref.typeSelect(ecore::EClass)»
«ENDDEFINE»

«DEFINE sub FOR ecore::EClass»
«this.name»
«ENDDEFINE»


Can anyone imagine the problem? Can I solve the issue on the XPand site?
Re: [XPand2] Unknown type 'ecore::EClass' [message #662873 is a reply to message #662869] Fri, 01 April 2011 06:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6137
Registered: July 2009
Senior Member
Hi,

can you show us how you call the XPand Template?

~Christian
Re: [XPand2] Unknown type 'ecore::EClass' [message #662875 is a reply to message #662869] Fri, 01 April 2011 06:52 Go to previous messageGo to next message
Christopher Gerking is currently offline Christopher Gerking
Messages: 39
Registered: April 2011
Member
I am currently using an MWE2 workflow file.

module xyz.generator

import org.eclipse.xtend.typesystem.emf.*
import org.eclipse.emf.mwe.utils.*
import org.eclipse.xpand2.*

var projectName = "my.generation"
var sourceFolder = "platform:/resource/${projectName}/src"
var sourceGenFolder = "../${projectName}/src-gen"

var xyzPackage = "xyz.XyzPackage"

var model = "${sourceFolder}/My.xyz"

Workflow {
	
	bean = StandaloneSetup {
		platformUri = ".."
	}
		
	bean = EmfMetaModel : mm_emf {
		metaModelPackage = "${xyzPackage}"
	}
	
	component = Reader {
		uri = "${model}"
		modelSlot = "model"
	}
			
	component = Generator {
		metaModel = mm_emf
		expand = "template::mydomain::main FOR model"
		outlet = {
			path = "${sourceGenFolder}" 
			append = true
		}
		fileEncoding = "UTF8"
	}

}
Thanks for the reply!

[Updated on: Fri, 01 April 2011 06:53]

Report message to a moderator

Re: [XPand2] Unknown type 'ecore::EClass' [message #662884 is a reply to message #662875] Fri, 01 April 2011 07:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6137
Registered: July 2009
Senior Member
Hi,

you use the EmfMetaModel for your dsl in your workflow
maybe you have configure one for ecore itself too.

(pseudo code)

bean = EmfMetaModel : mm_ecore {
		metaModelPackage = "org.eclipse.emf.ecore.EcorePackage"
	}


metaModel = mm_ecore


~Christian
Re: [XPand2] Unknown type 'ecore::EClass' [message #662987 is a reply to message #662869] Fri, 01 April 2011 14:14 Go to previous message
Christopher Gerking is currently offline Christopher Gerking
Messages: 39
Registered: April 2011
Member
Yes, thank you very much!
Previous Topic:[Xpand/Xtend] Deleting elements from one List affects the elements on another List
Next Topic:[Acceleo3] Meta model in separate project
Goto Forum:
  


Current Time: Mon Jul 28 20:33:17 EDT 2014

Powered by FUDForum. Page generated in 0.02669 seconds