How to interact with metamodel.ecore and Model.xmi elements in one template [message #975014] |
Wed, 07 November 2012 09:26  |
Eclipse User |
|
|
|
Hello all ,
I have question concerning xpand , I have create a metamodel with the some eclasses , attributes and references . after that I create a dynamic instance of the metamodel to generate Model.xmi and I built the model.xmi according to the structure of the metamodel.My question how I can combine between the elements of the Metamodel and the Model.xmi in one template file .
Ex . I have eclass called Entity in my metamodel
and I have created three Entities Students, lectures, Lecturers in my Model.xmi
I want to generate with xpand somthing like
Entity (no , Students)
Entity (no , lectures)
Entity (no , Lecturers)
and this should be automatically , i tried some code here
«DEFINE main FOR ecore::EPackage»
«FILE name+".txt"»
«EXPAND classifier FOREACH eClassifiers.typeSelect(ecore::EClass) »
«ENDFILE»
«ENDDEFINE»
«DEFINE classifier FOR ecore::EClass»
«name» (#no ,«EXPAND class FOREACH name »
«ENDDEFINE»
«DEFINE class FOR name »
«name»
«ENDDEFINE»
I have a mistake in the second xpand statment that name is not collection , but how a can get all the entities that I defined ?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04067 seconds