Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] Running Xpand Workflow via Equinox Launcher
[Xpand] Running Xpand Workflow via Equinox Launcher [message #989531] Thu, 06 December 2012 16:23 Go to next message
Dale Pennington is currently offline Dale Pennington
Messages: 6
Registered: November 2012
Junior Member
I have a workflow that works with Xpand and does of fine job of generating the code I need when I run it from within the Eclipse Workbench (the usual right click/Run As).

But we want to run from console (actually a build script) as this is only part of a larger product build. While the doc does give the WorkflowRunner class, to run it directly requires setting up a classpath to a large number of jars in the eclipse/plugins directory, which we would prefer to avoid.

So instead I tried to use the Eclipse Equinox Launcher. The command line I used was :

java -jar /opt/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar -application org.eclipse.emf.mwe.core.WorkflowRunner src/workflow/ddmGenerator.mwe

This seems to launch the Workflow OK, and we get through the load ecore steps, when we get to Check (which does no actual checks, but works OK within Workbench), we fail on null pointer exception that appears to be deep inside the component code (log file attached).

So, the question is, has anyone successfully used Equinox to run an Xpand workflow? Or have then done the base standalone with a hand generated classpath ?

Thanks for your time
Dale Pennington
  • Attachment: log
    (Size: 5.49KB, Downloaded 75 times)
Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #989542 is a reply to message #989531] Thu, 06 December 2012 16:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6298
Registered: July 2009
Senior Member
Hi what about using the eclipse export -> java -> runnable jar file
wizard. It frees you from doing the class path job yourself

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #989579 is a reply to message #989542] Thu, 06 December 2012 20:20 Go to previous messageGo to next message
Dale Pennington is currently offline Dale Pennington
Messages: 6
Registered: November 2012
Junior Member
You know, I tried the runnable jar file wizard, but stalled on step 2, as there were no options under Launch Configuration.

As far as I can tell, what I should be exporting is runner, not my Xpand project. Also that still leaves future issues of what I need to check into the CM system and what I edit (which should be under CM) when modifing stuff.

Part of it is understanding what the workflow needs actually, and what is also being done for me under the covers by Eclipse. I suspect my issue is the standalone run is not doing the Eclipse special helping steps (like compiling the java extensions into a .class file).

I am going to attempt to do the standalone option, just to see if I get the same issue (i.e. the logged error seemed to hit in the workflow, not the launcher, so I suspect my problem is at a lower level).

Dale
Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #989581 is a reply to message #989579] Thu, 06 December 2012 20:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6298
Registered: July 2009
Senior Member
Hi,

hi you have to call a main class e.g. workflowrunner once to be able to select the lauch config
(run -> runconfigurations, select java app, and then hit the new symbol)

it will work standalone without any eclipse

~Christian
Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #989780 is a reply to message #989581] Fri, 07 December 2012 17:32 Go to previous messageGo to next message
Dale Pennington is currently offline Dale Pennington
Messages: 6
Registered: November 2012
Junior Member
Yep, I got it to run standalone OK. The next step is to find all the command line parameters.

The workflow file is easy, and the docs mention -p to override the properties (the sample appears to be -p<prop name>=<overridevalue>. But it does not mention how to override the process monitor. The default you get seems to be printing debug oriented data, and I would prefer to use the no output one (I think its the NullProcessMonitor). Any ideas on where that level of documentation is ?

Dale

Expansion on the above. I appear to have run into a quick with the properties options. Following the example in the documentation, I used

java -cp <classpath> org.eclipse.emf.mwe.core.WorkflowRunner -pkey=newvalue workflow.mwe

It turns out that the -p option needs to follow the workflow file, otherwise you get a wrong parameter syntax error. Figured adding to what is know cannot hurt.

[Updated on: Fri, 07 December 2012 17:47]

Report message to a moderator

Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #989796 is a reply to message #989780] Fri, 07 December 2012 20:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6298
Registered: July 2009
Senior Member
HI,

feel free to file a bug against the doc. btw did hay have a look at http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.emf.mwe.doc%2Fhelp%2Fworkflow_reference_workflow_configuration.html

~Christian
Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #990026 is a reply to message #989796] Mon, 10 December 2012 14:45 Go to previous messageGo to next message
Dale Pennington is currently offline Dale Pennington
Messages: 6
Registered: November 2012
Junior Member
That is the reference I used. What I need now is the details of the parameters you can pass to workflow runner. The javadoc on the workflow runner class mentions that the ProcessMonitor is an input parameter, but no details on how you specify it. The reference I found on the class is at :

http://download.eclipse.org/modeling/emft/mwe/javadoc/2.3/index.html?org/eclipse/emf/mwe/utils/Reader.html

Dale

Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #990102 is a reply to message #990026] Mon, 10 December 2012 21:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6298
Registered: July 2009
Senior Member
Hmm something like -m org.eclipse.emf.mwe.core.monitor.NullProgressMonitor doesnt work?
Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #990309 is a reply to message #990102] Tue, 11 December 2012 18:50 Go to previous messageGo to next message
Dale Pennington is currently offline Dale Pennington
Messages: 6
Registered: November 2012
Junior Member
I have not seen documentation for it, but I did give it a try. Doing it before the Workflow file name, such as :

WorkflowRunner -m <NullMonitor> Workflow.mwe -p<setting>

caused WorkflowRunner to die on an illegal index exception. Putting it after the Workflow.mwe (either before or after the -p flags) had no apparent effect on the output, I still got the messages in the form of :

Dec 11, 2012 12:46:26 PM org.eclipse.xpand2.Generator invokeInternal2

Note that these do not show up when running within eclipse, so I am assuming they come from the ProcessMonitor.

Dale
Re: [Xpand] Running Xpand Workflow via Equinox Launcher [message #990316 is a reply to message #990309] Tue, 11 December 2012 19:50 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6298
Registered: July 2009
Senior Member
Guess you have to debug the runner Wink
Previous Topic:JET2 User Regions
Next Topic:[XPAND] Adding a template to classpath
Goto Forum:
  


Current Time: Wed Sep 17 05:47:49 GMT 2014

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

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