Skip to main content



      Home
Home » Eclipse Projects » BPMN 2.0 Modeler » How to open bpmn files properly
How to open bpmn files properly [message #1735047] Tue, 14 June 2016 18:31 Go to next message
Eclipse UserFriend
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.

http://i.imgur.com/arzG58O.png

I don't know whats going on. Hope someone have a tip for this.

Thank you,
Delacyr

[Updated on: Tue, 14 June 2016 18:35] by Moderator

Re: How to open bpmn files properly [message #1735051 is a reply to message #1735047] Tue, 14 June 2016 19:29 Go to previous messageGo to next message
Eclipse UserFriend
Take a look at the BPMN2DiagramWizard.performFinish() and BPMN2DiagramCreator.
Re: How to open bpmn files properly [message #1735150 is a reply to message #1735051] Wed, 15 June 2016 17:40 Go to previous message
Eclipse UserFriend
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 17:41] by Moderator

Previous Topic:Help save the BPMN2 Modeler Project from extinction!
Next Topic:How to use a custom icons?
Goto Forum:
  


Current Time: Sat Jun 21 20:29:51 EDT 2025

Powered by FUDForum. Page generated in 0.05260 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top