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

Bug 525261

Summary: Add a technical id for elements in aird resource
Product: [Modeling] Sirius Reporter: Laurent Fasani <laurent.fasani>
Component: CoreAssignee: Laurent Fasani <laurent.fasani>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: florian.barbin, laurent.fasani, maxime.porhel, minhtutonthat, pierre-charles.david
Version: 4.1.1Keywords: triaged
Target Milestone: 6.1.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/126190
https://git.eclipse.org/r/126268
https://git.eclipse.org/r/127184
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d314a1effab4083901b47a5c987b603548c5daac
https://git.eclipse.org/r/128315
https://git.eclipse.org/r/128376
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=4a7656f8cc74ccb8e8b561a8a7592aee6432a7aa
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=fca72ec510d6153e265823f65cb0e93ab11e8681
https://git.eclipse.org/r/128405
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d3b62553572ea3a2ae5080baa9f718b2dd1f43a7
https://git.eclipse.org/r/128517
https://git.eclipse.org/r/130079
https://git.eclipse.org/r/130124
https://git.eclipse.org/r/130136
https://git.eclipse.org/r/130139
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=828c9cb50d2669c928f20b941507698dde9bc0b6
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=6e23ad466b959068d9444664984d1ca59245fcb8
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=6f6299c9fa4754cd5f4ef90bbf515b84a61e6d81
https://git.eclipse.org/r/130158
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=3aca9b5245e6ba16d7cc0f07000bda7447580e96
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=bdd78fcfefe41f214a57ce06d86390d8199a0f1b
https://git.eclipse.org/r/130164
https://git.eclipse.org/r/130163
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=3955179f441028b6ad7a0692c8e3fa6db02decfd
https://git.eclipse.org/r/130167
https://git.eclipse.org/r/130383
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2c9e207aa63a3a819acbad4f55732c2b9be57084
https://git.eclipse.org/r/130596
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=fdc13c4b20d3178bd50def55b214353cfbc3bdb1
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7995ab61eab618e4797e5c527a4266bcc00b331c
Whiteboard:
Bug Depends on:    
Bug Blocks: 543049    

Description Laurent Fasani CLA 2017-09-27 05:43:21 EDT
ISSUE:
Currently, for a local modeling project, the aird resource uses UUIds(org.eclipse.sirius.business.internal.resource.AirDResourceImpl.useUUIDs() returns true) for its contained elements.
In the persisted aird file, it results of of xmiid attribute for every xml elements.

Some other application based on Sirius may serialize the aird resource differently for example in a database. In that case, AirDResourceImpl is not used but a resource which is not a XMIResourceImpl.

The consequence is when the application converts AirdResource from an implementation that not have xmiids to the AirDResourceImpl one, the xmiid are recreated and are different from the one used at the last AirDResourceImpl instanciation.

The consequence is that the aird file which has passed through the mechanism of convertion becomes different while no contained elements has changed.
That is problematic for workflow that considere aird changes. Typically for file versioning application such as git.

PROPOSAL:
The proposal is to have a technical id attribute for every object in the aird resource. This technical id would be used as uuid and, as any other attributes, would be persisted whatever the aird resource implementation is used.

As a consequence, the meta-model of objects persisted in aird resource has to be changed. It covers:
* sirius meta model (viewpoint.ecore, diagram.ecore, tree.ecore, table.ecore, sequence.ecore). Actually, only viewpoint.ecore would be changed as it defined the super class of all other classes in other meta-models.
* viewpoint description metamodel (viewpoint.ecore)
* GMF meta-model (annotation.ecore)
Comment 1 Pierre-Charles David CLA 2018-06-26 03:10:54 EDT
*** Bug 531410 has been marked as a duplicate of this bug. ***
Comment 2 Eclipse Genie CLA 2018-07-17 12:20:25 EDT
New Gerrit change created: https://git.eclipse.org/r/126190
Comment 3 Eclipse Genie CLA 2018-07-18 11:01:01 EDT
New Gerrit change created: https://git.eclipse.org/r/126268
Comment 4 Eclipse Genie CLA 2018-08-08 06:27:18 EDT
New Gerrit change created: https://git.eclipse.org/r/127184
Comment 6 Minh Tu Ton That CLA 2018-08-17 11:09:57 EDT
*** Bug 538044 has been marked as a duplicate of this bug. ***
Comment 7 Eclipse Genie CLA 2018-08-29 12:32:00 EDT
New Gerrit change created: https://git.eclipse.org/r/128315
Comment 8 Eclipse Genie CLA 2018-08-30 10:42:21 EDT
New Gerrit change created: https://git.eclipse.org/r/128376
Comment 11 Eclipse Genie CLA 2018-08-31 02:26:30 EDT
New Gerrit change created: https://git.eclipse.org/r/128405
Comment 13 Eclipse Genie CLA 2018-09-02 23:37:33 EDT
New Gerrit change created: https://git.eclipse.org/r/128517
Comment 14 Maxime Porhel CLA 2018-09-12 03:42:31 EDT
The above gerrit has been abandonned in favor of an equivalent change (https://git.polarsys.org/r/#/c/6521/) directly in Capella which want to keep the old uid as new uri fragment for the DRepresentation elements. Sirius will continue to keep the same urifragment when used outside of Capella: the old xmi:id of DRepresentation is kept as new uid and the previous uid is dropped by the automatic migration (the GMF diagram element reference and the DRepresentation.repPath are updated).
Comment 15 Laurent Fasani CLA 2018-09-17 10:20:14 EDT
This ticket is technical. 
It is covered by many junit test and many manual tests

No validatio is required.
Comment 16 Maxime Porhel CLA 2018-09-27 11:06:40 EDT
Copy representation action and copy paste are currently broken due to this evolution. 

A specific Copier must at least be used.
Comment 17 Eclipse Genie CLA 2018-09-28 05:01:17 EDT
New Gerrit change created: https://git.eclipse.org/r/130124
Comment 18 Eclipse Genie CLA 2018-09-28 07:58:41 EDT
New Gerrit change created: https://git.eclipse.org/r/130136
Comment 19 Eclipse Genie CLA 2018-09-28 08:22:08 EDT
New Gerrit change created: https://git.eclipse.org/r/130139
Comment 23 Eclipse Genie CLA 2018-09-28 10:28:56 EDT
New Gerrit change created: https://git.eclipse.org/r/130158
Comment 26 Eclipse Genie CLA 2018-09-28 11:16:40 EDT
New Gerrit change created: https://git.eclipse.org/r/130164
Comment 27 Eclipse Genie CLA 2018-09-28 11:16:42 EDT
New Gerrit change created: https://git.eclipse.org/r/130163
Comment 29 Eclipse Genie CLA 2018-09-28 11:45:03 EDT
New Gerrit change created: https://git.eclipse.org/r/130167
Comment 30 Laurent Fasani CLA 2018-10-02 05:44:32 EDT
There is still some commit needed to complete tests for copy/paste
Comment 31 Eclipse Genie CLA 2018-10-04 03:01:49 EDT
New Gerrit change created: https://git.eclipse.org/r/130383
Comment 33 Eclipse Genie CLA 2018-10-08 05:12:03 EDT
New Gerrit change created: https://git.eclipse.org/r/130596
Comment 36 Laurent Fasani CLA 2018-10-09 09:25:57 EDT
This ticket was for technical work. It will be validated by software based on Sirius
Comment 37 Pierre-Charles David CLA 2018-10-19 12:47:48 EDT
Available in Sirius 6.1.0, see https://wiki.eclipse.org/Sirius/6.1.0
Comment 38 Laurent Fasani CLA 2019-01-07 11:59:15 EST
This ticket had introduced a regression. See ticket https://bugs.eclipse.org/bugs/show_bug.cgi?id=543049