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

Bug 320599

Summary: [ATL] Rules order has an impact on wether xmi::id are copied or not
Product: [Modeling] MMT.ATL Reporter: Sébastien Gandon <sgandon>
Component: EngineAssignee: mmt-atl.toolkit-inbox <mmt-atl.toolkit-inbox>
Status: ASSIGNED --- QA Contact:
Severity: major    
Priority: P3 CC: dennis.wagelaar, frederic.jouault, william.piers
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Eclipse project for ATL xmiid copy error none

Description Sébastien Gandon CLA 2010-07-22 05:13:51 EDT
Build Identifier: Version: 3.5.2 Build id: M20100211-1343, ATL 3.0.2

I have an ATL transformation where all the classes have an xmi:ID that I need to be kept. So every transformation rule
starts with
__xmiID__ <- s.__xmiID__, 

the problem is that the first rule in the ATL file does not get to copy the xmi:id whereas all other rules work fine.

The more strange thing is that if I move the rule at the bottom of the file the xmi:ID is copyed but then all the previous rules do not get their ID copied ?????

The workaround I found is move around the rules to find the correct order in to have all my xmi::id(s) copied. It seems that container rules needs to be placed first. 

Reproducible: Always

Steps to Reproduce:
1.unzip the attached eclipse project and run the included launchers to demonstrate the woring script and the non working script
Comment 1 Sébastien Gandon CLA 2010-07-22 05:14:33 EDT
Created attachment 174947 [details]
Eclipse project for ATL xmiid copy error
Comment 2 William Piers CLA 2010-08-20 08:07:04 EDT
Thanks for the test project. I investigated and it appears that the VM reorganizes some EObjects in the resource and loses the id.
The elements creation order causes this reorganization, that's why your workaround works.
I do not have the correction for the moment, so the workaround is the best solution at this time. Please comment this bug if it becomes insufficient.
Comment 3 Frédéric Jouault CLA 2010-09-03 12:10:41 EDT
It seems that like UML profile operation calls, XMI ID initialization should be delayed by the VM until the end of the transformation (i.e., until model structure does not change).