2011-01-27 69 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