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

Bug 330899

Summary: Save should automatically create a correct "import" and ns prefixes
Product: [Modeling] MDT.BPMN2 Reporter: Reiner Hille <reiner.hille-doering>
Component: CoreAssignee: Henning Heitkoetter <hheitkoetter>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Reiner Hille CLA 2010-11-23 05:40:10 EST
If there are cross resource references (e.g. created using "Load Resource" feature, the BPMN2Resource should ensure that they are correctly imported using the BPMN2 Import mechanism so that they are not lost after save.
Comment 1 Henning Heitkoetter CLA 2010-11-29 04:37:56 EST
Hi Reiner,

are you working on this or planning to do so? If not, I'd be willing to implement this, as I also need this feature. I had implemented something similar for bug 301328 (for the "old" metamodel).

As far as I see it, all external references have to be checked for existence of a corresponding import element while preparing to save (e.g. in Bpmn2ResourceImpl.prepareSave). If no import element is found, a new one should be created - this has to be done before actually beginning to serialize.

With EcoreUtil.ExternalCrossReferencer.find(Resource) there is a utility method for finding all external references. Alternatively, we could continue to use the already existing loop over all referenced objects in prepareSave - whatever is faster.
Comment 2 Reiner Hille CLA 2010-11-29 04:48:49 EST
Hi Henning,
yes, this is exactly what I had in mind too. Please proceed implementing it if you have time.
I'm currently working for Extensibility and for a URIConverter for XSD (as they don't support id object resolution.

Reiner.
Comment 3 Henning Heitkoetter CLA 2010-12-02 09:39:22 EST
Fixed in commit 147aede43d4438c4195bee60fa2b4a0f5c51c52e