2011-01-27 84 views
0

试图将gmf与xpand集成。将gmf与xpand oaw集成

我创建了一个菜单,并在gmf清单文件中使用扩展命令。并试图调用xpand生成器。

该命令的代码如下所示

public class customCommand extends AbstractHandler implements IHandler { 

@Override 
public 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; 
} 

} 

我已经能够成功地获取路径的工作流程。 现在在调用工作流程时,我将不得不将gmf图表文件输入到工作流程中。但我怎么能给文件的路径?

我通过打开另一个工作台来执行我的gmf digram: 但是,现在,我如何获得gmf图文件的路径?

我在我的工作流程中注册了epackage。

能否请您尽快指导我的项目截止日期。

回答

1

IAML project使用openArchitectureWare XP和实现代码生成。作为如何将两者连接在一起的示例,您可以查看GenerateCodeAction的源代码 - 相关方法是doExecute()。希望这有助于:)

+0

嗨jevon谢谢你的回复,但我两周前完成了项目。希望它应该对别人有用:) – Ravi 2011-03-18 04:34:53