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

Bug 511211

Summary: [Model Import] Labels missing on inherited ports after import of legacy model
Product: [Modeling] Papyrus-rt Reporter: Peter Cigehn <peter.cigehn>
Component: toolAssignee: smaoui asma <asma.smaoui>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: asma.smaoui, charles, eposse, papyrus-bugs, sredding
Version: 0.8.0   
Target Milestone: 0.9.0   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/90632
Whiteboard: depends_on_papyrus
Bug Depends on: 511917    
Bug Blocks:    
Attachments:
Description Flags
Example model with capsule structure inheritance following the classic "interface capsule pattern" none

Description Peter Cigehn CLA 2017-01-27 11:20:00 EST
Created attachment 266493 [details]
Example model with capsule structure inheritance following the classic "interface capsule pattern"

The attached model contains a rather classic example of the so called "interface capsule pattern". And "interface capsule" is basically a capsule with no behavior or decomposition into capsule parts. It only specifies the external interface of a capsule using relay ports on its border.

Then these "interface capsules" are inherited by "implementation capsules" who can implement behavior or perform further decomposition into capsule parts, using delegation connectors to delegate the external interface further to any of the decomposed capsule parts.

When importing this model into Papyrus-RT, the ports inherited from the "interface capsule" does not have any labels in the "implementation capsule".

Steps to reproduce:

1) Import the attached model to Papyrus-RT format
2) Open the imported model and check the capsule structure diagrams for the "ImplementationCapsuleA/B/C" in the "Implementation Capsules" package.
3) Observe how none of the imported ports on the border of the capsule shows their name label
Comment 1 Christian Damus CLA 2017-01-31 08:18:34 EST
The problem with the inherited ports' labels isn't that they are missing, but that they are somehow not recognized as name labels for those ports.  The "Manage Connector [sic] Labels" dialog doesn't show the name label for the inherited port in this imported model as it does of a similar inherited port in a model created in Papyrus-RT.

The most obvious difference that I see as compared to the a native Papyrus-RT diagram is that the labels explicitly reference their ports, instead of just inheriting (overload!) the element reference from the parent port shape view.  But deleting that href in the *.notation file doesn't seem to fix the problem, and besides, internal ports and ports on parts do the same in their labels, and they are fine.
Comment 2 Peter Cigehn CLA 2017-01-31 08:34:32 EST
Regarding ports on capsule part, it can also be noted for some reason one of the ports on the capsule parts in the capsule structure diagram for "StructureImplementationCapsule" in the "Structure Capsules" package does not show its port label either, i.e. port1 on partA. For partB and partC the labels of the ports are shown.

I do know that I had some "issues" with port1, regarding getting its position to be inherited correctly, when editing the model. Maybe this is some effect of those positioning "issues" that I had.

I spotted this issue when writing Bug 511380 related to that the connectors are not visible between the ports on the capsule parts in this capsule structure diagram.
Comment 3 Peter Cigehn CLA 2017-02-01 10:47:14 EST
I am not sure why this one was planned for future? Either bring it back to "unplanned" or it should be included at least in 1.0, or even possibly 0.9.
Comment 4 Peter Cigehn CLA 2017-02-01 10:59:58 EST
(In reply to Peter Cigehn from comment #3)
> I am not sure why this one was planned for future? Either bring it back to
> "unplanned" or it should be included at least in 1.0, or even possibly 0.9.

Not sure why it was Ernesto that updated the Target Milestone to Future (including updating Target Milestone for lots of other as well). I am adding Simon on Cc to make sure he gets notified regarding my previous comment.
Comment 5 Charles Rivet CLA 2017-02-01 11:57:20 EST
(In reply to Peter Cigehn from comment #4)
> (In reply to Peter Cigehn from comment #3)
> > I am not sure why this one was planned for future? Either bring it back to
> > "unplanned" or it should be included at least in 1.0, or even possibly 0.9.
> 
> Not sure why it was Ernesto that updated the Target Milestone to Future
> (including updating Target Milestone for lots of other as well). I am adding
> Simon on Cc to make sure he gets notified regarding my previous comment.

The Target Milestones assignments were done in a meeting where Ernesto had control of the updates - Simon was present at the meeting.
Comment 6 Charles Rivet CLA 2017-02-01 12:03:39 EST
Assigning to 0.9 to align with Tuleap priorities.
Comment 7 Simon Redding CLA 2017-02-01 14:03:46 EST
(In reply to Charles Rivet from comment #5)
> (In reply to Peter Cigehn from comment #4)
> > (In reply to Peter Cigehn from comment #3)
> > > I am not sure why this one was planned for future? Either bring it back to
> > > "unplanned" or it should be included at least in 1.0, or even possibly 0.9.
> > 
> > Not sure why it was Ernesto that updated the Target Milestone to Future
> > (including updating Target Milestone for lots of other as well). I am adding
> > Simon on Cc to make sure he gets notified regarding my previous comment.
> 
> The Target Milestones assignments were done in a meeting where Ernesto had
> control of the updates - Simon was present at the meeting.

Peter - we went through the bugs which have not been assigned a target milestone and set them with what we think they should be. If you disagree, then simply raise the issue on the bug and we will re-consider. In the event we do not agree, we will discuss on the Friday call. We could wait until the Friday call and review all new bugs, but we feel this is more efficient. When we set the target milestone, it is our opinion and in no way final. 

Regards,

Simon
Comment 8 Eclipse Genie CLA 2017-02-08 09:12:56 EST
New Gerrit change created: https://git.eclipse.org/r/90632
Comment 9 smaoui asma CLA 2017-02-08 09:20:16 EST
(In reply to Christian W. Damus from comment #1)
> The problem with the inherited ports' labels isn't that they are missing,
> but that they are somehow not recognized as name labels for those ports. 
> The "Manage Connector [sic] Labels" dialog doesn't show the name label for
> the inherited port in this imported model as it does of a similar inherited
> port in a model created in Papyrus-RT.
> 
> The most obvious difference that I see as compared to the a native
> Papyrus-RT diagram is that the labels explicitly reference their ports,
> instead of just inheriting (overload!) the element reference from the parent
> port shape view.  But deleting that href in the *.notation file doesn't seem
> to fix the problem, and besides, internal ports and ports on parts do the
> same in their labels, and they are fine.

You are not very far from the solution, I analyzed the pb and it comes from this strange element reference. infact, if you delete it also in the PortNameLabel of the parent port, the label will be shown in the diagram

the toLabel() mapping inherits from the PapyrusNode mapping that set the element, it should not be like this, there is a toPapyrusConenctorLabel() that did not set the element, I create then a toPapyrusNodeLabel() mapping  that did not set the element and  make the tolabel() inherite from it.

For inherited Port on parts there is no Port_Shape created for them, so the pb is not shown

Peter moved on port (and then an explicit Port Shape is created with PortNameLabel that refer to the element) that's why the label is not shown for this particular port.
Comment 10 smaoui asma CLA 2017-02-08 09:22:03 EST
I forgot to create a Papyrus bug that blocks this one and refer to it for the patch proposed in gerrit :( 

I will do this right now :)
Comment 11 smaoui asma CLA 2017-02-10 05:40:39 EST
this was fixed in Papyrus see Bug 511917 for more details
Comment 12 Peter Cigehn CLA 2017-02-14 07:01:50 EST
Verified to be fixed in the latest Papyrus-RT build, based on the latest Papyrus build. The port name label is now shown also for inherited ports, including ports on inherited capsule parts.
Comment 13 Peter Cigehn CLA 2017-02-14 07:02:05 EST
Closing as verified fixed.