|Problem running xtext workflow in Plugin Environment [message #1004590]
||Wed, 23 January 2013 14:05
| Bhanu Pratap
Registered: April 2010
In Eclipse Plugin Environment, Mwe2StandaloneSetup fails to run xtext workflow.
We need to run xtext workflow using some user-specified, external workflow(.mwe2) and grammar(.xtext) files. This is achieved by creating an eclipse plugin and running a workflow from a new "Context Menu". The location of .mwe2 and .xtext files is specified by the user.
In the attachment, the sample plugin is used to re-create this problem.
PS: To demonstrate the problem, location of .mwe2 and .xtext files is hard-coded to be User's Home directory("user.home") in NewAction.java
Steps to reproduce
1. Import this zip file in eclipse as an existing project:
File -> Import -> Existing Projects into workspace
2. Copy "grammar.xtext" and "GenerateGrammar.mwe2" into your "Home" directory(directory path returned by System.getProperty("user.home")) and Edit the following in "GenerateGrammar.mwe2" file to specify this directory :
var grammarURI = "file:///<your-home-directory>/grammar.xtext"
3. Launch this plugin as an eclipse application
4. In the new workbench, Right click on any file and choose "New SubMenu -> New Action"
Step 3 should run the workflow successfully, but it fails with the following exception even when all the dependencies are satisfied:
Resource '/org.eclipse.xtext.xbase/model/Xbase.genmodel' does not exist"
Injector inj = new Mwe2StandaloneSetup().createInjectorAndDoEMFRegistration();
Mwe2Runner runner3 = inj.getInstance(Mwe2Runner.class);
String wfFile3str = System.getProperty("user.home")+File.separator+"GenerateGrammar.mwe2";//"GenerateTutorial";
File wfFile3 = new File(wfFile3str);
org.eclipse.emf.common.util.URI wfuri = org.eclipse.emf.common.util.URI.createFileURI(wfFile3.getAbsolutePath());
// Class path of the xtext generator
runner3.run(wfuri, new HashMap<String, String>());
Any pointers to solve such problem would be highly appreciated..
Thanks in advance..
[Updated on: Wed, 23 January 2013 14:17]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01747 seconds