summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Kulla2010-08-29 14:23:41 (EDT)
committerSven Efftinge2010-08-30 02:59:37 (EDT)
commited4574c13ee85f522751cf48d16f8004986aa06d (patch)
tree9db5ee138222248a0e47bad0c68a178066035afe
parent7d7f05f0568be7ecdd5a4d7daac3a624f2eeca22 (diff)
downloadorg.eclipse.mwe-ed4574c13ee85f522751cf48d16f8004986aa06d.zip
org.eclipse.mwe-ed4574c13ee85f522751cf48d16f8004986aa06d.tar.gz
org.eclipse.mwe-ed4574c13ee85f522751cf48d16f8004986aa06d.tar.bz2
Give access to the workflow context.
-rw-r--r--plugins/org.eclipse.emf.mwe2.launch/src/org/eclipse/emf/mwe2/launch/runtime/Mwe2Runner.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.mwe2.launch/src/org/eclipse/emf/mwe2/launch/runtime/Mwe2Runner.java b/plugins/org.eclipse.emf.mwe2.launch/src/org/eclipse/emf/mwe2/launch/runtime/Mwe2Runner.java
index 062fafa..332bdf1 100644
--- a/plugins/org.eclipse.emf.mwe2.launch/src/org/eclipse/emf/mwe2/launch/runtime/Mwe2Runner.java
+++ b/plugins/org.eclipse.emf.mwe2.launch/src/org/eclipse/emf/mwe2/launch/runtime/Mwe2Runner.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine;
import org.eclipse.emf.mwe2.language.mwe2.Module;
import org.eclipse.emf.mwe2.language.mwe2.Mwe2Package;
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflow;
+import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext;
import org.eclipse.emf.mwe2.runtime.workflow.WorkflowContextImpl;
import org.eclipse.xtext.mwe.RuntimeResourceSetInitializer;
import org.eclipse.xtext.mwe.UriFilter;
@@ -43,6 +44,9 @@ public class Mwe2Runner {
@Inject
private Provider<ResourceSet> resourceSetProvider;
+ @Inject(optional=true)
+ private IWorkflowContext context = new WorkflowContextImpl();
+
public void run(URI createURI, Map<String, String> params) {
Resource resource = resourceSetProvider.get().getResource(createURI, true);
if (resource != null) {
@@ -77,7 +81,7 @@ public class Mwe2Runner {
+ object.getClass() + "'.");
}
try {
- ((IWorkflow) object).run(new WorkflowContextImpl());
+ ((IWorkflow) object).run(context);
} catch (RuntimeException e) {
throw new RuntimeException("Problems running workflow " + moduleName + ": " + e.getMessage(), e);
}
@@ -116,5 +120,13 @@ public class Mwe2Runner {
public void setInitializer(RuntimeResourceSetInitializer initializer) {
this.initializer = initializer;
}
+
+ public void setWorkflowContext (IWorkflowContext context) {
+ this.context = context;
+ }
+
+ public IWorkflowContext getWorkflowContext () {
+ return context;
+ }
}