Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » How to run MWE2 workflow from my application(want to run MWE2 workflow programatically from my application)
How to run MWE2 workflow from my application [message #639044] Mon, 15 November 2010 04:09 Go to next message
Raj  is currently offline Raj Friend
Messages: 2
Registered: September 2010
Junior Member
I like to know how to run MWE2 workflow programmatically from my application.

I have used the xtext example mydsl to create a xtext project and want to use the default generator (xpand) project to generate the code with given xpand template.

when i run it manually the workflow generates the code in src-gen folder. In the generator, go to src->workflow->MyDslGenertor.mwe2, right click on that and Run As -> MWE2 workflow generates the code.

But when i try call the method() from my plugin project's sample action, its giving me the following error.
------------------------------------------------------------ ------------
SEVERE: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at createSAXParseException(Unknown Source)
at fatalError(Unknown Source)
at ortError(Unknown Source)
at alError(Unknown Source)
at pl$ Source)
at Source)
at cannerImpl.scanDocument(Unknown Source)
at n.parse(Unknown Source)
at n.parse(Unknown Source)
at nknown Source)
at .parse(Unknown Source)
at$JAXPSA XParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.mwe.internal.core.ast.parser.WorkflowParser. parse(
at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.p arseAndInitialize(
at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.p arseInitAndCreate(
at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.p arseInitAndCreate(
at org.eclipse.emf.mwe.core.WorkflowRunner.prepare(WorkflowRunn
at ava:290)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(
at org.eclipse.jface.action.ActionContributionItem.access$2(Act
at org.eclipse.jface.action.ActionContributionItem$6.handleEven t(
at org.eclipse.swt.widgets.EventTable.sendEvent( :84)
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch( :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(
at org.eclipse.ui.internal.Workbench.access$4( 27)
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault (
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework( 619)
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(
15 Nov, 2010 9:35:27 AM org.eclipse.emf.mwe.core.WorkflowRunner logIssues
SEVERE: [ERROR]: Content is not allowed in prolog.(Element: workflow\TmptGenerator.mwe2; Reported by: -UNKNOWN-)
15 Nov, 2010 9:35:27 AM org.eclipse.emf.mwe.core.WorkflowRunner prepare
SEVERE: Workflow interrupted because of configuration errors.
------------------------------------------------------------ --------------

Any idea to resolve this problem.
Thanks in advance

Re: How to run MWE2 workflow from my application [message #639126 is a reply to message #639044] Mon, 15 November 2010 11:43 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

This indicates that .mwe2 files are recognized as EMF resources, but use the default XMIResource for loading. This should not be the case when MWE2 Runtime is configured properly, since this would assign .mwe2 with the special Resource implementation needed. Did you include the o.e.emf.mwe2.language.ui pluginin your target platform? This would do the necessary setup on activation.


Need professional support for Xtext, EMF, Eclipse IDE?
Go to:
Twitter : @kthoms
Blog :
Re: How to run MWE2 workflow from my application [message #639341 is a reply to message #639044] Tue, 16 November 2010 07:55 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14655
Registered: July 2009
Senior Member
Hello Raj, WorkflowRunner is for MWE (1) Workflows only. For Mwe2 use Mwe2Runner but note: there are currently bugs regarding running Mwe2 Workflows in an OSGi Environment.


Twitter : @chrdietrich
Blog :
Previous Topic:[Acceleo] Problem when generating code with GMF
Next Topic:[Acceleo] ESE2010 Tutorial
Goto Forum:

Current Time: Sun Mar 03 07:12:12 GMT 2024

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

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

Back to the top