Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BPMN Modeler » Parse a .bpmn-File
Parse a .bpmn-File [message #520392] Fri, 12 March 2010 08:46 Go to next message
Kachel_Bac is currently offline Kachel_BacFriend
Messages: 2
Registered: March 2010
Junior Member
I'm trying to convert BPMN-Diagramms created with the BPMN-modeler into our own modeling-language. So i have to parse the .bpmn-File. My problem is that I don't understand how the .bpmn-file is created and what it's structure is. It is neither consistent with the .xsd not with the .ecore in the Model.
So all I can do at the moment is to look into the .bpmn-file and figure out what it's structure is.
One of my greatest problems is, that there are two IDs for every element (except associations) and I dont't know wich one is referenced.

So can you please tell me how it is created?
Re: Parse a .bpmn-File [message #524478 is a reply to message #520392] Thu, 01 April 2010 06:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Trust me, the bpmn file is consistent with the xsd and the ecore file -
since everything is generated from them.

How do you parse the file ? Through a XML parser ? Why don't you use EMF
to load the file and browse it ?

On 3/12/10 12:46 AM, Kachel_Bac wrote:
> I'm trying to convert BPMN-Diagramms created with the BPMN-modeler into
> our own modeling-language. So i have to parse the .bpmn-File. My problem
> is that I don't understand how the .bpmn-file is created and what it's
> structure is. It is neither consistent with the .xsd not with the .ecore
> in the Model.
> So all I can do at the moment is to look into the .bpmn-file and figure
> out what it's structure is.
> One of my greatest problems is, that there are two IDs for every element
> (except associations) and I dont't know wich one is referenced.
>
> So can you please tell me how it is created?
Re: Parse a .bpmn-File [message #524502 is a reply to message #524478] Thu, 01 April 2010 08:05 Go to previous messageGo to next message
Kachel_Bac is currently offline Kachel_BacFriend
Messages: 2
Registered: March 2010
Junior Member
Thanks for the reply.
Never worked with EMF before.I am using it since a few days. Fixed a lot of my Problems.
Re: Parse a .bpmn-File [message #637089 is a reply to message #524502] Thu, 04 November 2010 07:14 Go to previous messageGo to next message
Tri Kurniawan is currently offline Tri KurniawanFriend
Messages: 10
Registered: October 2010
Junior Member
I have the same question, but how can I do that? I don't know how to use ResourceSet to get bpmn file. Anyone can help me please? Thanks a lot.
Re: Parse a .bpmn-File [message #637150 is a reply to message #637089] Thu, 04 November 2010 11:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

> I have the same question, but how can I do that? I don't know how to use
> ResourceSet to get bpmn file. Anyone can help me please? Thanks a lot.

try this:
File bpmnFile = new File(_pathToFile_);
ResourceSet rs = new ResourceSetImpl();
URI uri = URI.createFileURI(bpmnFile.getAbsolutePath());
Resource resource = rs.getResource(uri, true);
BpmnDiagram bpmnModel = (BpmnDiagram ) resource.getContents().get(0);

best regards,
Gilbert
Re: Parse a .bpmn-File [message #637625 is a reply to message #637150] Mon, 08 November 2010 03:28 Go to previous messageGo to next message
Tri Kurniawan is currently offline Tri KurniawanFriend
Messages: 10
Registered: October 2010
Junior Member
Thanks a lot. I've had a try to do so, by using a template plugin example hello world from eclipse. I just put a line of instantiating a ResourceSet object as follow (on the SampleAction.java) and got a problem:

public void run(IAction action) {
Date dt = new Date();
/*ResourceSet rs = new ResourceSetImpl();*/
MessageDialog.openInformation(
window.getShell(),
"One",
"Hello, Eclipse world " + dt.toString());
}

When I open the line, it does not work, but if I close the line the dialog can be shown. My planning is, when those code works I want to put information of a certain bpmn model on the dialog e.g. name pool, etc., just for testing. I do not know what is going on, I am a beginner in this plug n development. Can help me please? Thanks.

Takoner
Re: Parse a .bpmn-File [message #637659 is a reply to message #637625] Mon, 08 November 2010 08:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

I think you should tell us about what exactly does not work. Any console
output or error log entries?

Takoner wrote:
> Thanks a lot. I've had a try to do so, by using a template plugin
> example hello world from eclipse. I just put a line of instantiating a
> ResourceSet object as follow (on the SampleAction.java) and got a problem:
>
> public void run(IAction action) {
> Date dt = new Date();
> /*ResourceSet rs = new ResourceSetImpl();*/
> MessageDialog.openInformation(
> window.getShell(),
> "One",
> "Hello, Eclipse world " + dt.toString());
> }
>
> When I open the line, it does not work, but if I close the line the
> dialog can be shown. My planning is, when those code works I want to put
> information of a certain bpmn model on the dialog e.g. name pool, etc.,
> just for testing. I do not know what is going on, I am a beginner in
> this plug n development. Can help me please? Thanks.
>
> Takoner
Re: Parse a .bpmn-File [message #637670 is a reply to message #637659] Mon, 08 November 2010 10:05 Go to previous message
Tri Kurniawan is currently offline Tri KurniawanFriend
Messages: 10
Registered: October 2010
Junior Member
No console output shown as expected, and I can not debug at all as well. Thanks.
Previous Topic:Generating bpmn file in a server runtime environment
Next Topic:Version of BPMN specification
Goto Forum:
  


Current Time: Fri Mar 29 09:44:25 GMT 2024

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

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

Back to the top