[Sirius][ClassDiagram] Condition to display view of PrimitiveType must be fixed
| Bugzilla Link | 582167 |
| Status | NEW |
| Importance | P3 major |
| Reported | Jul 03, 2023 07:52 EDT |
| Modified | Jul 04, 2023 08:23 EDT |
| Version | 0.7.0 |
| Blocks | 582168 |
Description
Steps to reproduce:
- Take the Eclipse Modeling Package(in order to get OCL)
- Install Papyrus-Sirius
- Create a Papyrus-Sirius Class Diagram
- Create a PrimitiveType in this diagram.
-> the PrimitiveType will be created semantically, but won't be represented graphically.
The problem comes from Sirius interpreter which mislead UML::PrimitiveType from the UML metamodel and UML::PrimitiveType from http://www.eclipse.org/ocl/1.1.0/UML
The bug has already been fixed in the Papyrus Sirius ProfileDiagram in commit c9a0596a.
A new service has been created : org.eclipse.papyrus.sirius.uml.diagram.common.services.CommonDiagramServices.isTypeOf(Element, String) and used in the VSM.
<nodeMappings name="PRD_PrimitiveType" preconditionExpression="aql:self.oclIsTypeOf(uml::PrimitiveType)" deletionDescription="//@ownedViewpoints[name='ProfileDiagram']/@ownedRepresentations[name='ProfileDiagram']/@defaultLayer/@toolSections.2/@ownedTools[name='PRD_Delete_All']" labelDirectEdit="//@ownedViewpoints[name='ProfileDiagram']/@ownedRepresentations[name='ProfileDiagram']/@defaultLayer/@toolSections.6/@ownedTools[name='NamedElement_name_EditionTool']" semanticCandidatesExpression="aql:self.packagedElement" domainClass="uml::PrimitiveType">
became: (self.oclIsTypeOf -> self.isTypeOf)
<nodeMappings name="PRD_PrimitiveType" preconditionExpression="aql:self.isTypeOf('uml::PrimitiveType')" deletionDescription="//@ownedViewpoints[name='ProfileDiagram']/@ownedRepresentations[name='ProfileDiagram']/@defaultLayer/@toolSections.2/@ownedTools[name='PRD_Delete_All']" labelDirectEdit="//@ownedViewpoints[name='ProfileDiagram']/@ownedRepresentations[name='ProfileDiagram']/@defaultLayer/@toolSections.6/@ownedTools[name='NamedElement_name_EditionTool']" semanticCandidatesExpression="aql:self.packagedElement" domainClass="uml::PrimitiveType">\
\
We can also met the same bug with Variable metaclass which exists in the two metamodels.