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 for the tip. It looks close to what I need. I found the run method but how can I get the errors from running the workflow? In MWE there was a class called Issues which enabled me to extract the output from running the workflow. I cannot find this in MWE2.
Mwe2 is not a full / 1:1 replacement of mwe.
Mwe2 has no Isse Support. It only logs them (trough Mwe2Bridge)
feels free to file a bug/enhancementrequest whatever ...
OK I get it. We are now running the MWE2 workflow from our Java/Swing application using a launch configuration from the Eclipse workbench. Any errors are returned as exceptions which is fine for now i.e. we can live without the Issues class.
However we have an issue exporting our application as a standalone jar we have a problem specifying the URI to the MWE2 workflow. How to specify a file via a URI which is in a directory in a plugin e.g. x.y.z/mydir/myworkflow.mwe2?
We are not used to using URI's to specify resources inside plugins.
Mmm I did not think of that. Maybe there is a way of specifying a file in a jar using a URI? If not I only see a solution (hack) using the file system and stroing the file in a known place wrt to the jar. But I would prefer a way of getting it out of the jar however.
With MWE we stored the workflow in the jar and specified its path as "x/y/z/mydir/myworkflow.mwe"
this problem (how to run our Xtend workflow from a standalone Swing application) has become a blocking problem. Please, if anyone can help us we will be grateful!
When we run from an Eclipse workbench configuration it works. When we run it from an exported jar as a Swing appli we get this exception:
Running Workflow for Code files
url=jar:file:/mntdirect/_users/verdier/org.tango.pogo.jar!/fr/esrf/tango/pogo/generator/PogoDslGeneratorMWE.mwe2
uri=jar:file:/mntdirect/_users/verdier/org.tango.pogo.jar!/fr/esrf/tango/pogo/generator/PogoDslGeneratorMWE.mwe2
java.lang.IllegalArgumentException: Unsupported path : (only folders and archives are supported).
at org.eclipse.xtext.mwe.PathTraverser.findAllResourceUris(PathTraverser.java:46)
at org.eclipse.xtext.mwe.PathTraverser.resolvePathes(PathTraverser.java:33)
at org.eclipse.xtext.mwe.RuntimeResourceSetInitializer.getPathToUriMap(RuntimeResourceSetInitializer.java:54)
at org.eclipse.xtext.mwe.RuntimeResourceSetInitializer.getInitializedResourceSet(RuntimeResourceSetInitializer.java:72)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.findModule(Mwe2Runner.java:112)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:77)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
at org.tango.pogo.pogo_gui.tools.OAWutils.runWorkflow(OAWutils.java:291)
at org.tango.pogo.pogo_gui.tools.OAWutils.generate(OAWutils.java:229)
at org.tango.pogo.pogo_gui.Pogo.generateSourceFiles(Pogo.java:132)
at org.tango.pogo.pogo_gui.Pogo.main(Pogo.java:281)
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>());
}
}
thanks a lot for your example. We will try it - it looks easy when you do it. We will prepare an example for you if we are still stuck. I am out of town so there will be some delay in getting back to you.
I notice a small difference between your example and ours. We are trying to load the backend file from inside a jar. You have specified a file directly with a relative path. We will try to reproduce your example and then work from there.
thanks a lot for your example. We will try it - it looks easy when you do it. We will prepare an example for you if we are still stuck. I am out of town so there will be some delay in getting back to you.
I notice a small difference between your example and ours. We are trying to load the backend file from inside a jar. You have specified a file directly with a relative path. We will try to reproduce your example and then work from there.
thanks a lot for your example. We will try it - it looks easy when you do it. We will prepare an example for you if we are still stuck. I am out of town so there will be some delay in getting back to you.
I notice a small difference between your example and ours. We are trying to load the backend file from inside a jar. You have specified a file directly with a relative path. We will try to reproduce your example and then work from there.
thanks a lot for your example. We will try it - it looks easy when you do it. We will prepare an example for you if we are still stuck. I am out of town so there will be some delay in getting back to you.
I notice a small difference between your example and ours. We are trying to load the backend file from inside a jar. You have specified a file directly with a relative path. We will try to reproduce your example and then work from there.
thanks a lot for your example. We will try it - it looks easy when you do it. We will prepare an example for you if we are still stuck. I am out of town so there will be some delay in getting back to you.
I notice a small difference between your example and ours. We are trying to load the backend file from inside a jar. You have specified a file directly with a relative path. We will try to reproduce your example and then work from there.
thanks a lot for your example. We will try it - it looks easy when you do it. We will prepare an example for you if we are still stuck. I am out of town so there will be some delay in getting back to you.
I notice a small difference between your example and ours. We are trying to load the backend file from inside a jar. You have specified a file directly with a relative path. We will try to reproduce your example and then work from there.