Skip to main content


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 10:14 Go to next message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 117
Registered: April 2011
Senior 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 10:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14736
Registered: July 2009
Senior Member
Hi,

can you show us how you call the XPand Template?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: [XPand2] Unknown type 'ecore::EClass' [message #662875 is a reply to message #662869] Fri, 01 April 2011 10:52 Go to previous messageGo to next message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 117
Registered: April 2011
Senior 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 10:53]

Report message to a moderator

Re: [XPand2] Unknown type 'ecore::EClass' [message #662884 is a reply to message #662875] Fri, 01 April 2011 11:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14736
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: [XPand2] Unknown type 'ecore::EClass' [message #662987 is a reply to message #662869] Fri, 01 April 2011 18:14 Go to previous message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 117
Registered: April 2011
Senior 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: Tue Dec 10 21:26:06 GMT 2024

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

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

Back to the top