Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » arguments to mwe2 workflow(how to retrieve parameters inside a workflow file)
arguments to mwe2 workflow [message #1386187] Sat, 14 June 2014 14:49 Go to next message
Bruce L. is currently offline Bruce L.Friend
Messages: 81
Registered: June 2011
Member
Hi,
I'm trying to run a mwe2 workflow file (mostly copied from one generated by xtext) from the command line, with ant.

Here is the fragment of my ant file
    <target name="generate-xtext-artifacts">
        <java classpathref=...
              classname="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher" 
              fork="true">
            <arg value="<my_workflow>.mwe2"/>
            <arg value="-p"/>
            <arg value="outdir=<some-path>"/>
        </java>
    </target>


I found on the web about the way of passing arguments to the launcher, with '-p'.
However I don't know how to access such parameters from within the workflow file itself. How can I access the value of 'outdir' in my workflow?

Thanks
B
Re: arguments to mwe2 workflow [message #1386191 is a reply to message #1386187] Sat, 14 June 2014 15:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13314
Registered: July 2009
Senior Member
Hi

that should work via declaring a var


var xxx = "........" // will be overriden

use: "${xxx}"


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: arguments to mwe2 workflow [message #1386194 is a reply to message #1386191] Sat, 14 June 2014 16:29 Go to previous message
Bruce L. is currently offline Bruce L.Friend
Messages: 81
Registered: June 2011
Member
Thanks, it worked.

So in my case (inside the .mwe2 file):

var outdir = "default_value" // overridden by the command line parameter

var some_other_var = "${outdir}"

[...]



thanks
Previous Topic:Determining presence/absence of third parameter
Next Topic:[SOLVED] Generics in Xtext
Goto Forum:
  


Current Time: Thu Jan 23 01:20:26 GMT 2020

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

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

Back to the top