Bug 564657 - Pb if 2 representations have the same id (or empty id)
Summary: Pb if 2 representations have the same id (or empty id)
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 6.3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2020-06-25 10:43 EDT by Laurent Redor CLA
Modified: 2021-05-05 09:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Redor CLA 2020-06-25 10:43:50 EDT
This case is not managed by Sirius. Validation rules exist to avoid it. But if we don't validate the VSM we can have this problem. One of the problem is that the VSM becomes unusable (no way to open it with VSM editor).

Steps to reproduce:
* Create a new VSM
* Create a new Viepoint
* Create a new Cross Table Description
* Create a new Tree Description
* Create a new Tree Item (in the Tree Description).
* Create a new Direct Edit tool uner the Tree Item
* Save
* KO: A warning is logged in the Error Log view: "The viewpoint registry was not able to load this file test.odesign"
* Close the VSM editor
* Open the VSM (with the VSM editor)
* KO (same underlying problem: "java.lang.IllegalArgumentException: The feature 'subItemMappings' is not a valid reference")

The problem is because the 2 representation descriptions have the same id (here a blank id). And there are URI ref that are wrong. One in this sample, the "mapping" reference for direct edit tool:

<?xml version="1.0" encoding="UTF-8"?>
<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/table/description/1.1.0" xmlns:description_2="http://www.eclipse.org/sirius/tree/description/1.0.0" name="test" version="12.0.0.2017041100">
  <ownedViewpoints>
    <ownedRepresentations xsi:type="description_1:CrossTableDescription"/>
    <ownedRepresentations xsi:type="description_2:TreeDescription">
      <subItemMappings semanticCandidatesExpression="feature:eAllContents">
        <defaultStyle>
          <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
          <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
        </defaultStyle>
        <directEdit mapping="//@ownedViewpoints[name='']/@ownedRepresentations[name='']/@subItemMappings[name='']">
          <mask mask="{0}"/>
          <element name="element"/>
          <root name="root"/>
        </directEdit>
      </subItemMappings>
    </ownedRepresentations>
  </ownedViewpoints>
</description:Group>