|
Re: Parse a .bpmn-File [message #524478 is a reply to message #520392] |
Thu, 01 April 2010 06:30 |
Eclipse User |
|
|
|
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 #637150 is a reply to message #637089] |
Thu, 04 November 2010 11:57 |
Eclipse User |
|
|
|
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 |
Tri Kurniawan 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 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04997 seconds