Bug 544563 - Regression - Viewpoint extension not working in sirius 6.1
Summary: Regression - Viewpoint extension not working in sirius 6.1
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 6.1.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 6.1.3   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 547727
  Show dependency tree
 
Reported: 2019-02-19 04:24 EST by Laurent Goubet CLA
Modified: 2019-06-17 10:46 EDT (History)
6 users (show)

See Also:


Attachments
Capella sample (8.73 KB, application/x-zip-compressed)
2019-02-22 06:01 EST, Pierre Guilet CLA
no flags Details
Capella sample (8.74 KB, application/x-zip-compressed)
2019-02-22 10:15 EST, Pierre Guilet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Goubet CLA 2019-02-19 04:24:14 EST
We had a diagram extension (I'll call it SMWReq) functional in Sirius 5.1 (Capella 1.2.0 and 1.2.1) but that started failing with Sirius 6.1 (Capella 1.3.0).

What we're doing is extend the "Requirements" Capella add-on (I'll call it ReqIF). Our extension defines a custom layer with reused mappings from the ReqIF layer, and custom tools applied on these reused mappings.

Both our viewpoint, SMWReq and the ReqIF viewpoint are enabled on a project. As such, both the ReqIF layer and our custom layer are available and can be selected on the diagrams. Since we're showing reused mappings, elements that are shown when selecting the ReqIF layer shoulw also be shown when using the SMWReq layer. This was functional in Sirius 5.1.

However, in Sirius 6.1, even though our SMWReq viewpoint is selected, and the SMWReq layer is available, none of the reused mappings are shown on the diagram when the layer is selected.

While debugging, we ultimately found out that "isInActivatedLayer" (org.eclipse.sirius.diagram.business.internal.metamodel.helper.LayerHelper.isInActivatedLayer(DiagramMappingsManager, DDiagramElement, DDiagram)) was returning the wrong result in Sirius 6.1 as compared to Sirius 5.1. There seem to be an issue with the ViewpointRegistry not properly cross-referencing our viewpoint in Sirius 6.1.

We've worked around the issue by forcing a resolveAll on our viewpoint as soon as the session opens:

for (Viewpoint vp : ViewpointRegistry.getInstance().getViewpoints()) {
	if (SMW_REQ_ID.equals(vp.getName())) {
		EcoreUtil.resolveAll(vp.eResource());
	}
}
Comment 1 Eclipse Genie CLA 2019-02-22 05:51:30 EST
New Gerrit change created: https://git.eclipse.org/r/137435
Comment 2 Pierre Guilet CLA 2019-02-22 06:01:22 EST
Created attachment 277659 [details]
Capella sample

Attached a capella sample with two designs A and B and layers importing A from B and layers from B importing requirement design.

Layer from B importing A mapping do work on built product.
Comment 3 Pierre Guilet CLA 2019-02-22 10:15:42 EST
Created attachment 277663 [details]
Capella sample

Steps to reproduce:

-launch a capella 1.3.0
-install feature of attached project
-import IFE
-activate viewpoints TheExtension1, TheExtension2
-open a [CDB] class diagram blank diagram
-activate layer extension2Layer

KO no mapping is shown in diagram.

If you change the viewpoint activation order in activator of attached plugin, re export the feature and update it in capella, activating the layer will now works.
Comment 5 Jerome Pequery CLA 2019-05-28 08:45:20 EDT
validated in TC 1.3.1 it7
Comment 6 Pierre-Charles David CLA 2019-06-17 10:46:51 EDT
Available in Sirius 6.1.3, see https://wiki.eclipse.org/Sirius/6.1.3