How to run an MWE2 workflow from Java [message #882888] |
Thu, 07 June 2012 12:11 |
Andy Gotz Messages: 32 Registered: July 2010 |
Member |
|
|
Hi,
we have an MWE2 workflow which we run from a launch configuration under eclipse. So far so good.
Now we want to run it from a Java class. Previously with MWE we used the class WorkflowEngine to run the workflow. What should we replace this class by? Is there an example we can follow? We also need to get access to the Issues for the output.
We are looking for any tips and/or links on how to do this.
Thanks
Andy
[Updated on: Thu, 07 June 2012 12:11] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to run an MWE2 workflow from Java [message #894138 is a reply to message #894020] |
Fri, 06 July 2012 21:38 |
|
Just gave it a try myself. as i already suggested the following works fine for me
package test;
import java.util.HashMap;
import org.eclipse.emf.mwe2.language.Mwe2StandaloneSetup;
import org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner;
import com.google.inject.Injector;
public class Main {
public static void main(String[] args) {
Injector i = new Mwe2StandaloneSetup().createInjectorAndDoEMFRegistration();
Mwe2Runner runner = i.getInstance(Mwe2Runner.class);
runner.run("test.TestModule", new HashMap<String, String>());
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05227 seconds