Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Xpand Workflow file
Xpand Workflow file [message #1021702] Wed, 20 March 2013 10:39
serhat gezgin is currently offline serhat gezgin
Messages: 231
Registered: January 2013
Location: Izmir
Senior Member
Hi,

I have problem with workflow. when i write this (by default)

<workflow>
	<property name="model" value="file:///C:\\Users\\unituser\\Desktop\\default.filesystem" />
	<property name="src-gen" value="file:///C:\\Users\\unituser\\Desktop\\" />
	
	<!-- set up EMF for standalone execution -->
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
		<platformUri value=".."/>
	</bean>
	
	<!-- instantiate metamodel -->
	<bean id="mm_emf" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
	<!-- load model and store it in slot 'model' -->
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="${model}" />
		<modelSlot value="model" />
	</component>
	
		<!-- check model -->
	<component class="org.eclipse.xtend.check.CheckComponent">
		<metaModel idRef="mm_emf"/>
		<checkFile value="metamodel::Checks" />
		<emfAllChildrenSlot value="model" />
	</component>

	<!--  generate code -->
	<component class="org.eclipse.xpand2.Generator">
		<metaModel idRef="mm_emf"/>
		<expand
			value="template::Template::main FOR model" />
		<outlet path="${src-gen}" >
			<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
		</outlet>
	</component>
</workflow>


workflow gives me;

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'filesystem' not found.

So i must write my model xsi:schemaLocation="filesystem metamodel/filesystem.ecore";

But how can i this done this code generation without xsi:schemaLocation ?

Because i know where is the metamodel and i want to give this info to workflow not model file.

Can i done this ? in xsd tutorial i can done this with this code;

<workflow>
  <component class="org.eclipse.xtend.typesystem.xsd.XMLReader">
    <modelSlot value="model" />
    <uri value="${modelFile}" />
    <metaModel id="mm"
      class="org.eclipse.xtend.typesystem.xsd.XSDMetaModel">
      <schemaFile value="metamodel/ir.xsd" />
    </metaModel>
  </component>
  <component class="org.eclipse.xpand2.Generator">
    <metaModel idRef="mm" />
    <expand value="template::DeepTravelTemplate::Root FOR model" />
    <outlet path="${toPath}" />
    <globalVarDef name="domainModelAbsClases" value="{}"/>
    <globalVarDef name="domainModelAbsAndConcreateClases" value="{}"/>
  </component>
</workflow>


with this model not need to know the metamodel location. How can i done this with emf models ?
Previous Topic:[Acceleo] How to make a type cast?
Next Topic:[Acceleo] Problem calling AcceleoService programatically
Goto Forum:
  


Current Time: Thu Apr 17 00:04:42 EDT 2014

Powered by FUDForum. Page generated in 0.01388 seconds