gpt4 book ai didi

java - 将 gmf 与 xpand oaw 集成

转载 作者:行者123 更新时间:2023-12-01 15:57:28 24 4
gpt4 key购买 nike

尝试将 gmf 与 xpand 集成。

我使用 gmf list 文件中的扩展名创建了一个菜单和命令。并尝试调用 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 图:但是,现在,我如何获取 gmf 图文件的路径?

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

你能指导一下吗,项目截止日期很快了。

最佳答案

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

关于java - 将 gmf 与 xpand oaw 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4817115/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com