Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Mwe2 Workflow - modify variables at runtime
Mwe2 Workflow - modify variables at runtime [message #1053125] Thu, 02 May 2013 15:09 Go to next message
Edwin Tuzar is currently offline Edwin TuzarFriend
Messages: 33
Registered: April 2013
Location: Kaiserslautern
Member

Hi,
I'm trying to make a tool in which the users can choose a model from different paths/ or create a model based on my language for the mwe2 file (not the ecore model!) and then the generated file to be placed where the user wants (directory etc..)
Now this works if I run the mwe2 file manually (right click -> run as), but I want a solution for doing this from code/runtime.

My question is if the following can be done:

to dynamically change the model path and the output outlet path (at runtime)
to run the mwe2 file at runtime (to don't need to go to press right click and run as ..stuff)
Thanks in advance!
Re: Mwe2 Workflow - modify variables at runtime [message #1053184 is a reply to message #1053125] Thu, 02 May 2013 22:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

afaik it is still not possible to programatically run a mwe2 workflow from an osgi environment (eclipse)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=318721

=> thus i'd simply create a java class that basically does the same as the workflow and call that one.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Mwe2 Workflow - modify variables at runtime [message #1053656 is a reply to message #1053184] Tue, 07 May 2013 07:48 Go to previous messageGo to next message
Edwin Tuzar is currently offline Edwin TuzarFriend
Messages: 33
Registered: April 2013
Location: Kaiserslautern
Member

Hi,
thanks for the answer! Could you please give me more details about the work around Smile
Because as far I understood is not possible to run this from an UI (for example a wizard).
The idea is that I'll want to make it possible that an user to set the path of where to save/set the file with my language "something.mylang" and then to run the generation from that (eventually before that to show the editor for a final check).
Any answer will be helpful. Thanks in advance!
Best regards,
Edwin W.T.


Edwin W.T.
Re: Mwe2 Workflow - modify variables at runtime [message #1053661 is a reply to message #1053656] Tue, 07 May 2013 08:05 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
I mean:

Workflow workflow = new Workflow();
workflow.addComponent(...);
workflow.addComponent(...);
workflow.addComponent(...);
workflow.preInvoke();
IWorkflowContext ctx = new WorkflowContextImpl();
ctx......
workflow.invoke(ctx);
workflow.postInvoke();

alternatively use mwe1

or no workflow at all (as i do it in my blog post)

http://christiandietrich.wordpress.com/2011/10/15/xtext-calling-the-generator-from-a-context-menu/


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Weird Scope provider behavior
Next Topic:strange behavior of XImportSection
Goto Forum:
  


Current Time: Tue Apr 16 19:05:44 GMT 2024

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

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

Back to the top