Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 22:31 Go to next message
Delacyr Ferreira is currently offline Delacyr FerreiraFriend
Messages: 20
Registered: February 2016
Junior Member
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 22:35]

Report message to a moderator

Re: How to open bpmn files properly [message #1735051 is a reply to message #1735047] Tue, 14 June 2016 23:29 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

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 21:40 Go to previous message
Delacyr Ferreira is currently offline Delacyr FerreiraFriend
Messages: 20
Registered: February 2016
Junior Member
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]

Report message to a moderator

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


Current Time: Wed Feb 21 04:09:33 GMT 2018

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

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