Bug 374970 - Ways to import/export xpdl
Summary: Ways to import/export xpdl
Status: NEW
Alias: None
Product: MDT.BPMN2
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-21 14:10 EDT by loic Missing name CLA
Modified: 2012-03-26 12:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description loic Missing name CLA 2012-03-21 14:10:23 EDT
Build Identifier: 0.7.0.201203160619 (also using bpmn2-modeler 0.0.1.201203161937)

Hi,

This is more an enhancement request or question on how to better extend the plug-in.  I would be interested to import and export xpdl 2.2 files using the same BPMN2.0 model.

What would be the best way to implement such feature ?

Could this plug-in offer hooks to easily build a BPMN2 model from an xpdl file and save the model in xpdl as well ?

Thanks.

Reproducible: Didn't try
Comment 1 Henning Heitkoetter CLA 2012-03-22 09:41:16 EDT
If you want to extend the BPMN2 editor, you should be able to use standard functionality provided by Eclipse, like implementing an IEditorActionDelegate and registering it as an extension of org.eclipse.ui.editorActions. You can have a look at our own SaveAsXMIAction, which also adds a new function to the editor.

Alternatively, you could add your new element in the popup menu for all BPMN2 resources (using the extension point org.eclipse.ui.popupMenus provided by Eclipse).

Please let me know if you need more specific means of integration with BPMN2.
Comment 2 loic Missing name CLA 2012-03-23 15:26:37 EDT
Thanks for the suggestions.

About the first one (extension of org.eclipse.ui.editorActions), I just realized that it might not work in my case, since I am using bpmn2-modeler as well, and it seems to overwrite the default bpmn2 editor (org.eclipse.bpmn2.presentation.Bpmn2EditorID) with its own (graphiti based org.eclipse.bpmn2.modeler.ui.bpmn2editor).  And looks like bpmn2-modeler editor disabled SaveAs feature.
My goal (if possible?) is to reuse as much as possible from bpmn2 (especially the model) and bpmn2-modeler (especially the graphical editor) to edit XPDL files.  So, the best would be to associate *.xpdl to the bpmn2-modeler editor and provide the necessary code to read the xpdl resource to populate the corresponding bpmn2 model.  And also provide a clever Save() operation for the editor, so if resource extension is .xpdl then use a SaveAsXpdl() operation to map the bpmn2 model to XPDL file format. (note: I am new in the field, maybe it does not make sense?)

About the second option (org.eclipse.ui.popupMenus), I explored it, but it would be good to add a "Save As XPDL" menu if a bpmn|bpmn2 file is selected.  It wont help much though to do a more integrated XPDL editor.

I am going to explore the bpmn2-modeler to see if like it does, I can write my own editor, leveraging all the graphical part, but extending to be associated to *.xpdl files and implementing alternative reader and writer for xpdl format.  I am just not sure where to hook this up...

If you have more suggestions or advises let me know (especially, if you think it is crazy or impossible :)

Thanks!
Comment 3 Henning Heitkoetter CLA 2012-03-26 12:12:11 EDT
If you want an on-the-fly-conversion between XPDL and BPMN2, you might want to look at EMF's resource mechanism. You might be able to provide your own implementation of org.eclipse.emf.ecore.resource.Resource, which reads XPDL and converts it to BPMN2, and register it for the file extension *.xpdl. This does not seem like an easy task, but could provide a transparent way to convert between XPDL and BPMN2. Xtext does something along these lines to provide EMF/XMI resources from text files written in a domain-specific language that has been created with Xtext.