Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Executing a workflow (MWE) using a Model.xmi which is not part of a resource(Reading a Model which is not part of a resource)
Executing a workflow (MWE) using a Model.xmi which is not part of a resource [message #968471] Fri, 02 November 2012 09:39
vikas yadav is currently offline vikas yadav
Messages: 3
Registered: November 2012
Junior Member
I am trying to execute a workflow using a standalone JAVA program. I want it to dynamically pick up a Model.xmi and generate code based on templates and workflows defined in my plug-in.

However, the only example I found using the following code:

StandaloneSetup setup = new StandaloneSetup();
setup.setPlatformUri("D:/workspace/experimental/");
Reader reader = new Reader();
reader.setModelSlot("model");
reader.setUri("platform:/resource/<<project name>>/src/Model.xmi");
WorkflowContext ctx = new WorkflowContextDefaultImpl();
reader.invoke(ctx, new NullProgressMonitor(), new IssuesImpl());
Map<String, Object> slotContents = new HashMap<String, Object>();
slotContents.put("model", ctx.get("model"));
Map<String, String> properties = new HashMap<String, String>();

String wfFile = "D:/src/workflow/generateAll.mwe";
new WorkflowRunner().run(wfFile, new NullProgressMonitor(), properties,
slotContents);

With this I understand that Model.xmi should always be part of some resource. Is it possible for me to read a standalone Model.xmi and execute my workflow?
Previous Topic:[Acceleo] Error launching main module as Acceleo Application
Next Topic:JET2 Tools broken in Juno and Keppler
Goto Forum:
  


Current Time: Wed Aug 20 04:50:56 EDT 2014

Powered by FUDForum. Page generated in 0.02225 seconds