Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [XPand] Programatically run Workflow
[XPand] Programatically run Workflow [message #1143505] Fri, 18 October 2013 08:22 Go to next message
Eclipse UserFriend
my workflow;

<workflow>
	<property name="modelFile"
		value="platform:/resource/com.mdd4cca.msf.codegen/src/ArgeMerkeziPortalı.content" />
	<property name="mmPackage" value="com.mdd4cca.msf.content.ContentPackage" />
	<property name="srcGenPath" value="src-gen" />
	<property name="mainDefine" value="template::Root::main" />
	<property name="fileEncoding" value="Windows-1254" />

	<bean id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" />

	<!-- Klasor temizler. -->
	<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
		<directory value="${srcGenPath}" />
	</component>

	<!-- Model dosyasini okur. -->
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="${modelFile}" />

		<!-- Daha sonra kullanilmak uzere degisken tanimlar. -->
		<modelSlot value="model" />
	</component>

	<!-- check model -->
	<!-- <component class="org.eclipse.xtend.check.CheckComponent"> -->
	<!-- <metaModel idRef="mm" /> -->
	<!-- <checkFile value="metamodel::Checks" /> -->
	<!-- <emfAllChildrenSlot value="model" /> -->
	<!-- </component> -->

	<component class="org.eclipse.xpand2.Generator">
		<metaModel idRef="mm" />

		<expand value="${mainDefine} FOR model" />

		<outlet path="${srcGenPath}/">
			<postprocessor class="output.CSharpBeautifier" />
		</outlet>

		<resourceManager
			class="org.eclipse.xtend.expression.ResourceManagerDefaultImpl">
			<fileEncoding value="${fileEncoding}" />
		</resourceManager>
	</component>
</workflow>


and when i run this workflow on runtime-eclipse via command i always get

"[ERROR]: No Definition 'template::Root::main for ..."

why i get this don't understand

anyone can help me ?

P.S i use doRun() method on Kepler

Regards
Re: [XPand] Programatically run Workflow [message #1143766 is a reply to message #1143505] Fri, 18 October 2013 12:08 Go to previous messageGo to next message
Eclipse UserFriend
Your resource manager won't be able to load the resource from the classpath. This is how the default implementation works, which is used in standalone mode. Likely you will find that ResourceManagerDefaultImpl#loadResource() will return null.

When running in a plugin, use the XpandPluginExecutionContext instead of XpandExecutionContextImpl. This registers a special resource manager, the PluginResourceManager.

Regards,
~Karsten
Re: [XPand] Programatically run Workflow [message #1148193 is a reply to message #1143766] Mon, 21 October 2013 10:34 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the answer.

As far as I know, It worked perfectly in Juno.

XpandPluginExecutionContext requires IXtendXpandProject object as a constructor parameter. How can I get IXtendXpandProject(or IProject) for an installed plugin?

Thank you.
Sincerely.
Re: [XPand] Programatically run Workflow [message #1186135 is a reply to message #1148193] Thu, 14 November 2013 14:00 Go to previous messageGo to next message
Eclipse UserFriend
By the way, I want to execute my template on Runtime Eclipse. Is "XpandPluginExecutionContext" right for my situation?

Thanks.
Re: [XPand] Programatically run Workflow [message #1219653 is a reply to message #1186135] Thu, 05 December 2013 09:00 Go to previous message
Eclipse UserFriend
Hi.

I solved the problem by changing package name workflow to a more qualified name com.akgun.workflow.
Previous Topic:[Xpand] C postprocessor
Next Topic:[Xpand/MWE] Scoping of global variables and element properties
Goto Forum:
  


Current Time: Wed Feb 19 19:34:27 GMT 2025

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

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

Back to the top