Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320599 - [ATL] Rules order has an impact on wether xmi::id are copied or not
Summary: [ATL] Rules order has an impact on wether xmi::id are copied or not
Status: ASSIGNED
Alias: None
Product: MMT.ATL
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: mmt-atl.toolkit-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-22 05:13 EDT by Sébastien Gandon CLA
Modified: 2011-05-12 06:50 EDT (History)
3 users (show)

See Also:


Attachments
Eclipse project for ATL xmiid copy error (302.78 KB, application/octet-stream)
2010-07-22 05:14 EDT, Sébastien Gandon CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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).