Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355639 - Change file extension from .bpmn2 to .bpmn and use content descriptors to associate with correct editor
Summary: Change file extension from .bpmn2 to .bpmn and use content descriptors to ass...
Status: RESOLVED FIXED
Alias: None
Product: BPMN2Modeler
Classification: SOA
Component: UI (show other bugs)
Version: 0.0.1   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: 0.0.1-M2   Edit
Assignee: Robert Brodt CLA
QA Contact:
URL: https://issues.jboss.org/browse/JBPM-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 06:04 EDT by Robert Brodt CLA
Modified: 2012-10-09 11:44 EDT (History)
1 user (show)

See Also:
bbrodt: iplog+


Attachments
Fix in BPMN2ContentDescriber (4.24 KB, text/plain)
2012-08-02 09:06 EDT, Robinson S CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Brodt CLA 2011-08-24 06:04:49 EDT
Currently the BPMN2 editor creates files with extension .bpmn2.

Although the spec does not explicitly indicate what file extension should be used, the examples distributed by the OMG use the .bpmn extension.

The issue is that currently this would conflict with users of the existing BPMN1 Eclipse editor.

Robert (Bob) Brodt added a comment - 09/Jun/11 5:23 PM

Still need to handle the case of files with .bpmn2 extension, which do not actually contain BPMN2 content. This shouldn't happen if new BPMN2 files are created with the wizard. Downgrading to minor.

Brian Fitzpatrick added a comment - 30/Jun/11 1:16 PM

There's some bizarre code around this issue in BPMN2Editor's getModelPathFromInput, which does a strange dance of adding the "bpmn2" file extension, then replacing it with a blank?? Something's off there.
Comment 1 Robinson S CLA 2012-08-02 09:06:22 EDT
Created attachment 219483 [details]
Fix in BPMN2ContentDescriber

Modification done is,

@Override
	public int describe(Reader contents, IContentDescription description) throws IOException {
		if(doDescribe(contents) == null){			
			//Show error if the file does not have BPMN2 content
			MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), 
					"Unsupported Content Type", "Unsupported content type in editor.\nThe file content will be lost if user modifies the file with BPMN2 editor.");
			return INVALID;
		}
		return VALID;
	}
Comment 2 Robinson S CLA 2012-08-02 09:13:02 EDT
(In reply to comment #1)
> Created attachment 219483 [details]
Fix in BPMN2ContentDescriber
> Modification done is,

@Override
	public int describe(Reader contents,
> IContentDescription description) throws IOException {
	
> if(doDescribe(contents) == null){			
			//Show error if the file does not
> have BPMN2 content
		
> MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().
> getActiveShell(), 
					"Unsupported Content Type", "Unsupported content
> type in editor.\nThe file content will be lost if user modifies the file
> with BPMN2 editor.");
			return INVALID;
		}
		return VALID;
	}


The above proposed solution is to alert the user that file content is invalid and if he attempts to add elements from the palette the existing content will be lost, ie. replaced with new BPMN2 content. Note that the message in the problems view is not in detail and clear.
Comment 3 Robert Brodt CLA 2012-09-26 15:12:32 EDT
Patch applied. Thanks again!