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 WorkflowRunner.run 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 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.rep ortError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFat alError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$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(WorkflowParser.java:76)
at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.p arseAndInitialize(WorkflowFactory.java:105)
at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.p arseInitAndCreate(WorkflowFactory.java:59)
at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.p arseInitAndCreate(WorkflowFactory.java:52)
at org.eclipse.emf.mwe.core.WorkflowRunner.prepare(WorkflowRunn er.java:332)
at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.j ava:290)
at com.ifx.dave.codegen.tmpt.gen.actions.Gen.run(Gen.java:81)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
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

Raj
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.

Regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
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: 14725
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.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Previous Topic:[Acceleo] Problem when generating code with GMF
Next Topic:[Acceleo] ESE2010 Tutorial
Goto Forum:
  


Current Time: Mon Oct 14 21:17:30 GMT 2024

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

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

Back to the top