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

Bug 468059

Summary: [tool] Cannot add capsule parts (or ports) from the palette onto a Composite Structure diagram
Product: [Modeling] Papyrus-rt Reporter: Ernesto Posse <eposse>
Component: toolAssignee: Charles Rivet <charles>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: charles, papyrus-bugs, peter.cigehn
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Error log, when adding element from UML-RT palette
none
New exception log none

Description Ernesto Posse CLA 2015-05-22 13:16:21 EDT
Steps to reproduce
------------------

1. Create new Papyrus Model with UML RealTime profile applied
2. Create new Composite Structure Diagram
3. Open the diagram; drag "Capsule" from the UML-RT palette onto the canvas, -or- click on "Capsule" on the UML-RT palette and then click on the canvas.

Result
------

Nothing happens. In particular the Capsule element is not added to the model.

Expected result
---------------

Capsule element should be added to the model and to the canvas.

Notes
-----

The same thing happens with other elements in the UML-RT palette (e.g. CapsulePart)

Test environment
----------------

Eclipse Modeling Tools

Version: Mars Release Candidate 1 (4.5.0RC1)
Build id: 20150521-1252

  Eclipse Modeling Tools	4.5.0.20150520-1810	epp.package.modeling	null
  Papyrus UML	1.1.0.201505221553	org.eclipse.papyrus.sdk.feature.feature.group	Eclipse Modeling Project
  Papyrus UML RealTime profile (Incubation)	1.1.0.201505221609	org.eclipse.papyrus.extra.umlrt.feature.feature.group	Eclipse Modeling Project
Comment 1 Ernesto Posse CLA 2015-05-22 13:19:00 EDT
Created attachment 253701 [details]
Error log, when adding element from UML-RT palette
Comment 2 Ernesto Posse CLA 2015-05-22 15:04:12 EDT
Tested on Windows 7. Same problem.
Comment 3 Ernesto Posse CLA 2015-07-27 12:40:16 EDT
Still happens on

  Papyrus UML	1.1.0.201507271324
  Papyrus UML RealTime profile (Incubation)	1.1.0.201507271343

on Mars
Comment 4 Peter Cigehn CLA 2015-08-21 04:54:27 EDT
I am not sure that this is the way we want the tool to work. The expected behavior is that when you create the capsule, its composite structure diagram is created automatically and the composite structure diagram displays its parent capsule.

It really does not make sense in the UML-RT DSML to have the possibility of first having an "empty" composite structure diagram onto which you create its capsule.

I suggest that we resolve this Bugzilla as invalid.
Comment 5 Charles Rivet CLA 2015-08-21 08:48:38 EDT
(In reply to Peter Cigéhn from comment #4)
> I am not sure that this is the way we want the tool to work. The expected
> behavior is that when you create the capsule, its composite structure
> diagram is created automatically and the composite structure diagram
> displays its parent capsule.
> 
> It really does not make sense in the UML-RT DSML to have the possibility of
> first having an "empty" composite structure diagram onto which you create
> its capsule.
> 
> I suggest that we resolve this Bugzilla as invalid.

I agree with Peter.

Traditionally, capsules have been created either from the Model Explorer or using a class diagram.

This scenario may also result in the diagram being owned, by default, by a model element that would not be a capsule - a bad practice considering it represents the "internal" of the capsule. This would result in the ability to delete the capsule ans to leave a now empty and useless diagram in the model (i.e., model pollution).
Comment 6 Ernesto Posse CLA 2015-08-21 16:11:13 EDT
I see your point, and I agree that the diagram should automatically create the capsule. But I think that the root of the bug is still valid. Even if there is already a capsule in the diagram, I cannot drag and drop a CapsulePart or an RTPort on it. In fact, the palette doesn't even have RTPort (that would be another bug).

So I think that there should should be a bug to track the issue of creating the capsule whenever a new composite structure diagram is added, but I also think that it should be possible to drag and drop capsule parts and ports, and therefore, I think this bug remains valid, but I'll rename it to reflect that it should apply to capsule parts and ports.
Comment 7 Peter Cigehn CLA 2015-08-24 02:54:24 EDT
I guess this is due to the same issue that I stumbled on, i.e. the UML-RT viewpoints it not active. See Bug 469851 Comment 14 for how to activate the UML-RT viewpoint. What is probably lacking is an explicit Bugzilla for the automatic activation of the UML-RT viewpoint as Remi explains.

If the UML-RT viewpoint is active, then you both get the creation of the composite structure diagram automatically when the capsule is created, as well as the relevant tools on the palette in the automatically created composite structure diagram being owned by the capsule.

Using these tools you should be able to create both ports and capsule parts.
Comment 8 Ernesto Posse CLA 2015-08-24 12:13:49 EDT
I wasn't aware of the viewpoints. But none of this works for me. I checked and the viewpoint was still set to "Default". But even after setting it to the UML-RT viewpoint, I get the same behaviour. And this is on a fresh, separate eclipse install that has only the MDT, Papyrus and PapyrusRT from the nightly update sites.
Comment 9 Peter Cigehn CLA 2015-08-24 13:37:18 EDT
Please note that after enabling the UML-RT viewpoint you need to create a new capsule which then gets a new capsule composite structure diagram created. It does not work on existing ordinary composite structure diagrams.
Comment 10 Ernesto Posse CLA 2015-08-24 13:50:48 EDT
I just realized the problem: there are two "UMLRealTime" context menus. It works with one but not the other, which I presume is an older menu that should go.

I've checked that with that menu it does work, so I'll close this one.
Comment 11 Ernesto Posse CLA 2015-08-24 14:08:17 EDT
I spoke too quickly. I'm reopening it.

Using that (new?) menu I can drag-and-drop capsule parts but not ports. I'm attaching the exception.
Comment 12 Ernesto Posse CLA 2015-08-24 14:08:48 EDT
Created attachment 256076 [details]
New exception log
Comment 13 Peter Cigehn CLA 2015-08-24 14:11:31 EDT
Yes, the duplication occurs if you install some component with dependencies to the old UML-RT profile in the Papyrus Extras component, at the same time as you install PapyrusRT. I've bumped into this myself, e.g. when installing the import tool. Then you get these double menus, apart from that other things seem to be messed up as well. Ensure that you only have the new PapyrusRT stuff installed.

Do you still have both profiles installed at the same time when you bump into these issues? I would suggest that you make a clean install of only the PapyrusRT tooling and make sure you do not have the old Papyrus Extras version installed at the same time.
Comment 14 Charles Rivet CLA 2016-08-12 15:59:11 EDT
Could not reproduce with: Papyrus RT Feature (Incubation) 0.7.2.201608111821
Closing as such.