Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330017

Summary: Relative import location can not be resolved when resource URI is relative
Product: [Modeling] MDT.BPMN2 Reporter: Henning Heitkoetter <hheitkoetter>
Component: CoreAssignee: Project Inbox <mdt-bpmn2-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Henning Heitkoetter CLA 2010-11-11 11:39:16 EST
The value of the location attribute of import elements should be interpreted as relative to the URI of the importing document.

Example:
Document /absolute/path/to/A.bpmn2 has an import element with location="subfolder/B.bpmn2". This should be resolved as "/absolute/path/to/subfolder/B.bpmn2".

At the moment, this only works if the BPMNResource of the importing document (A) that contains the import element is created with an absolute URI. If the resource has a relative URI (which should be common when constructing BPMN models), a relative import location can not be (de)resolved, as location and resource/base URI are relative.
(With the current implementation, it works if the import location is relative to the working directory instead of the importing document, which is not what we want, because the working directory of a program execution can change and has no meaning for the BPMN model.)

As a second way of specifying the import location, we should also support absolute URIs in the location attribute.
Comment 1 Henning Heitkoetter CLA 2010-11-11 12:01:35 EST
This affects saving and loading, so BpmnXmlHelper.getNsPrefix (for saving) and ~.getPathForPrefix or QNameURIHandler.resolve (for loading) need to be adapted.
Comment 2 Henning Heitkoetter CLA 2010-11-15 05:32:21 EST
Fixed in e9996e93e211031c6f1f6c263aa9dbbcb9ba2b11
Preceding commits introduce corresponding test cases.