no output from workflow called by java - action - debug action calls? [message #621120] |
Sun, 12 July 2009 19:21 |
Bill Hinge Messages: 156 Registered: July 2009 |
Senior Member |
|
|
Hi
I'm on the last leg - packaging my plugin
I have a plugin which is trying to run a mwe workflow
(the workflow runs in project explorer right click as expected)
When I export my plugin and load it, then run my action, the action
is called as evidenced by org.eclipse.jface.dialogs placed in my code.
I have checked that the workflow urls I am using point to resources
actually exist but I don't seem to be getting any output. Normally it
takes about 11 to 23 secs to run the workflow but through java it just
skips through
I'm selecting a gmf output file as my model file.
This is how I am calling my action (no exceptions thrown)
ngossModel is my GMF model file
Is there any better way of getting debug info from something called
from an action. The only way I can check things is via placing jface
dialogs in my code. Not sure how to use debugger on an action if
possible? (no debug or console)
regards
Steve
============================================================ =============
public void run(IAction action) {
try {
EObject source = getInput();
if (source == null) {
String title = Messages.RunTransformationAction_title;
String message = Messages.RunTransformationAction_message;
MessageDialog.openInformation(getShell(), title, NLS.bind(message,
file.getFullPath()));
} else {
URL url2 = new
URL(" platform:/plugin/org.tmf.businessService.ui/templates/busine ssServiceDemoWorkflow.mwe ");
org.eclipse.jface.dialogs.MessageDialog.openInformation(getS hell(),
"Debug", "Running workflow := " + url2.toString() );
URL url = FileLocator.toFileURL(url2);
URL url3 = new URL("platform:/plugin/org.tmf.businessService.ui");
URL url4 = FileLocator.toFileURL(url3);
org.eclipse.jface.dialogs.MessageDialog.openInformation(getS hell(),
"Step2", "url := " + url4.toString() );
Map<String, String> properties = new HashMap<String, String>();
Map<String, String> slotcontents = new HashMap<String, String>();
properties.put("ngossModel",
URI.createPlatformResourceURI(file.getFullPath().toString(),
true).toString());
properties.put("src-gen", Platform.getLocation().toOSString() +
file.getParent().getFullPath());
properties.put("project_home", url4.toString());
new WorkflowRunner().run(url.getPath(), new NullProgressMonitor(),
properties, slotcontents);
file.getParent().refreshLocal(IResource.DEPTH_ONE, new
org.eclipse.core.runtime.NullProgressMonitor());
org.eclipse.jface.dialogs.MessageDialog.openInformation(getS hell(),
"Done", "Transform run on := " + file.getName()
+ " output produced in location : " +
Platform.getLocation().toOSString() + file.getParent().getFullPath() );
}
} catch (Exception ex) {
handleError(ex);
}
}
Here is my workflow - it works if run on the workbench using 'run as'
I'm not seeing any console output
<?xml version="1.0" encoding="utf-8" ?>
<workflow>
<property name="workspace_loc" value="./" />
<property name="project_home" value="../org.tmf.businessService.ui" />
<property name="ngossModel" value="templates/default16.ngoss" />
<property name="src-gen" value="../org.tmf.businessService.ui/src-gen"/>
<property name="out" value="out" />
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value="../" />
<RegisterEcoreFile value="${project_home}/model/contract.ecore"/>
<RegisterEcoreFile value="${project_home}/model/sla.ecore"/>
<RegisterEcoreFile value="${project_home}/model/informationModel.ecore"/>
<RegisterEcoreFile value="${project_home}/model/ngoss.ecore"/>
<RegisterEcoreFile value="${project_home}/model/tam.ecore"/>
<RegisterEcoreFile value="${project_home}/model/sbvr.ecore"/>
<registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>
<registerGeneratedEPackage
value="org.eclipse.gmf.runtime.notation.NotationPackage"/>
</bean>
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="${project_home}/src-gen"/>
<component class="org.eclipse.emf.mwe.utils.Reader">
<firstElementOnly value="true" />
<modelSlot value="ngossModel"/>
<uri value="${ngossModel}"/>
</component>
<component class="org.eclipse.xpand2.Generator" id="ngossGenerate">
<metaModel id="mm"
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
<fileEncoding value="UTF-8"/>
<expand value="Demos::Main FOR ngossModel" />
<outlet path="${src-gen}">
<!-- postprocessor output configuration -->
</outlet>
</component>
</workflow>
|
|
|
Powered by
FUDForum. Page generated in 0.02917 seconds