integrating gmf with xpand oaw
trying to integrate gmf with xpand.
I created a menu, and command using extensions in gmf manifest file. and am trying to invoke xpand generator.
The code for the command is as shown below
public class customCommand extends AbstractHandler implements IHandler {
@Override
p开发者_如何转开发ublic Object execute(ExecutionEvent event) throws ExecutionException {
// TODO Auto-generated method stub
Shell s=HandlerUtil.getActiveShell(event);
MessageBox mb=new MessageBox(s,SWT.None);
WorkflowRunner runner = new WorkflowRunner();
Bundle bundle=Platform.getBundle("MistScriptGenerator");
URL wfUrl = bundle.getEntry("src/workflow/generator.oaw");
String wfFile = "";
try {
wfFile = FileLocator.toFileURL(wfUrl).getFile();
mb.setMessage(wfFile);
mb.open();
Map<String, String> properties = new HashMap<String, String>();
//properties.put("model", $diagramFile$.getLocation().toOSString());
properties=null;
boolean isSuccess = runner.run(wfFile,new org.openarchitectureware.workflow.monitor.NullProgressMonito r(), properties, null);
}
catch (Exception e)
{
}
return null;
}
}
I have been able to succesfully get the path for the workflow. Now while invoking the workflow I will have to input the gmf diagram file, to the workflow. But how can I give the path for the file ?
I execute my gmf digram by opening it another workbench: But, now, how do i get the path of gmf diagram file ?
I have registered epackage in my workflow.
Can you please guide me the project deadline is very soon.
The IAML project uses openArchitectureWare XPand to implement code generation. As an example of how to connect the two together, you can check out the source code for GenerateCodeAction -- the relevant method is doExecute()
. Hope this helps :)
精彩评论