MWE: delay issue with mwe invoked from Eclipse' action [message #816807] |
Fri, 09 March 2012 09:28  |
Karel Gardas Messages: 33 Registered: July 2009 |
Member |
|
|
Hello,
I'm playing with mwe/xpand in an attempt to generate simple xsd from ecore. The thing is working well already when invoked from Eclipse (right-click on xsd.mwe and executing it as a MWE Workflow).
My problem is that I've made a plugin which provides an action which invokes this xsd workflow on a selected ecore file. The problem is that the action is invoked, workflow is started but then it halts for about 2 minutes and then continues. During 2 minutes halt I don't see any huge memory allocations, or heavilly reading from disk or a lot of CPU consumption. Nothing. It (eclipse process) shows just very little activity at all. My code from action looks (f is selected IFile):
mon.subTask("Generate XML Schema for " + f.getName() + " model ...");
IPath model_path = f.getFullPath();
String wfFile = "workflow/xsd.mwe";
Map<String, String> properties = new HashMap<String, String>();
IPath src_gen = f.getParent().getLocation();
properties.put("src-gen", src_gen.toString());
properties.put("model", model_path.toString());
StringTokenizer tok = new StringTokenizer(f.getName(), ".");
String name = tok.nextToken();
String xsdFileName = name + ".xsd";
properties.put("xsdFileName", xsdFileName);
Map slotContents = new HashMap();
WorkflowRunner wrun = new WorkflowRunner();
wrun.run(wfFile , null, properties, slotContents);
f.getParent().refreshLocal(1, null);
I've stripped debug messages out. The output of workflow run invoked by this action then looks:
Mar 8, 2012 8:49:46 PM org.eclipse.emf.mwe.core.WorkflowEngine prepare
INFO: --------------------------------------------------------------------------------------
Mar 8, 2012 8:49:46 PM org.eclipse.emf.mwe.core.WorkflowEngine prepare
INFO: EMF Modeling Workflow Engine 1.1.1, Build v201108020506
Mar 8, 2012 8:49:46 PM org.eclipse.emf.mwe.core.WorkflowEngine prepare
INFO: (c) 2005-2009 openarchitectureware.org and contributors
Mar 8, 2012 8:49:46 PM org.eclipse.emf.mwe.core.WorkflowEngine prepare
INFO: --------------------------------------------------------------------------------------
Mar 8, 2012 8:49:46 PM org.eclipse.emf.mwe.core.WorkflowEngine prepare
INFO: running workflow: workflow/xsd.mwe
Mar 8, 2012 8:49:46 PM org.eclipse.emf.mwe.core.WorkflowEngine prepare
INFO:
Mar 8, 2012 8:49:46 PM org.eclipse.emf.mwe.utils.StandaloneSetup setPlatformUri
INFO: Registering platform uri '/export/home/karel/usr/local'
Mar 8, 2012 8:51:57 PM org.eclipse.emf.mwe.core.container.CompositeComponent internalInvoke
INFO: Reader: Loading model from platform:/resource//testECoreToXWiki/model2/rocket3.ecore
Mar 8, 2012 8:51:57 PM org.eclipse.emf.mwe.core.container.CompositeComponent internalInvoke
INFO: CheckComponent: slot model check file(s): metamodel::Checks
Mar 8, 2012 8:52:01 PM org.eclipse.emf.mwe.core.container.CompositeComponent internalInvoke
INFO: Generator: generating 'template::ecore2xsd::main FOR model' => /export/home/karel/runtime-EclipseApplication/testECoreToXWiki/model2
Mar 8, 2012 8:52:01 PM org.eclipse.xpand2.output.XmlBeautifier beforeWriteAndClose
SEVERE: Use the XmlBeautifier from XSD Feature: org.eclipse.xtend.typesystem.xsd.XMLBeautifier instead.
Mar 8, 2012 8:52:01 PM org.eclipse.xpand2.Generator invokeInternal2
INFO: Written 1 files to outlet [default](/export/home/karel/runtime-EclipseApplication/testECoreToXWiki/model2)
Mar 8, 2012 8:52:01 PM org.eclipse.emf.mwe.core.WorkflowEngine executeWorkflow
INFO: workflow completed in 3854ms!
Please see especially timing on those two lines:
Mar 8, 2012 8:49:46 PM org.eclipse.emf.mwe.utils.StandaloneSetup setPlatformUri
INFO: Registering platform uri '/export/home/karel/usr/local'
Mar 8, 2012 8:51:57 PM org.eclipse.emf.mwe.core.container.CompositeComponent internalInvoke
My question is: is this a know issue? If so, then is there any known fix or workaround for this. If not, then is there any way how to turn more verbose debugging on workflow so I can see more messages from it and judge better where it halts for those 2 minutes?
Thanks!
Karel
|
|
|
Re: MWE: delay issue with mwe invoked from Eclipse' action [message #816927 is a reply to message #816807] |
Fri, 09 March 2012 12:34   |
|
Hi Karel,
The StandaloneSetup will scan the subdirectories of the platformUri path for .project files. Usually the "platform path" should point to your workspace directory, so there is a limited number of directories to scan. In your case it is
'/export/home/karel/usr/local'
and I assume there a LOTS of directories in the deep file system hierarchy.
So move your projects to a better location, use this as platform path and it will work faster. You could also subclass StandaloneSetup and register this in your workflow to make it more fitting to your situation.
Regards,
~Karsten
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02291 seconds