How to open bpmn files properly [message #1735047] |
Tue, 14 June 2016 22:31  |
Eclipse User |
|
|
|
Hi,
I'm trying to open bpmn files programmatically, but without success until now. First, I'm getting the URI (java.net.URI) from bpmn file, but method BPMN2Editor.openEditor(modelURI) has another implementation of URI as parameter (org.eclipse.emf.common.util.URI).
Facing this question, I did a conversion from java.net.URI to o.e.emf.common.util.URI.
java.net.URI javanetURI = project.getFolder("FolderName").getFile("FileName").getLocationURI();
org.eclipse.emf.common.util.URI modelURI;
modelURI = org.eclipse.emf.common.util.URI.createURI(javanetURI.toString());
BPMN2Editor.openEditor(modelURI);
But even this way, when I called openEditor method, I got the "Failed to create the part's controls" error.

I don't know whats going on. Hope someone have a tip for this.
Thank you,
Delacyr
[Updated on: Tue, 14 June 2016 22:35] by Moderator Report message to a moderator
|
|
|
|
Re: How to open bpmn files properly [message #1735150 is a reply to message #1735051] |
Wed, 15 June 2016 21:40  |
Eclipse User |
|
|
|
Thank you Bob, it helped me and now it works. The new code follows below.
IPath path_BPDFolder = project.getFolder("FolderName").getFullPath().append("FileName");
org.eclipse.emf.common.util.URI modelURI;
modelURI = org.eclipse.emf.common.util.URI.createPlatformResourceURI(path_BPDFolder.toString(), true);
BPMN2Editor.openEditor(modelURI);
[Updated on: Wed, 15 June 2016 21:41] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02965 seconds