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

Bug 474481

Summary: [Core] Default naming for CapsuleParts and Ports should be enhanced
Product: [Modeling] Papyrus-rt Reporter: Remi Schnekenburger <rschnekenburger>
Component: coreAssignee: Christian Damus <give.a.damus>
Status: CLOSED FIXED QA Contact: Peter Cigehn <peter.cigehn>
Severity: enhancement    
Priority: P3 CC: papyrus-bugs, peter.cigehn
Version: 1.0.0   
Target Milestone: 0.8.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/71955
https://git.eclipse.org/c/papyrus-rt/org.eclipse.papyrus-rt.git/commit/?id=c08a1afb207370fb97552e9968e2a04483be43ea
Whiteboard:

Description Remi Schnekenburger CLA 2015-08-07 04:53:52 EDT
Currently, CapsuleParts and  RTPorts are named according to their type name when when are typed and if their current name is null. However, the name is not relying on the default initializer name framework, e.g. it will be always the same. There is not a suffix number to distinguish the different CapsulePart or Ports with a unique name.

The NamedElementInitializatier usually used in Papyrus coudl be used there.
Comment 1 Peter Cigehn CLA 2015-08-13 10:31:29 EDT
I have not had the time yet to test the latest build, but from the description I get the impression the capsule part and ports currently are named *exactly* the same as its type, i.e. capsule respectively protocol. 

Just to clarify, the name of the capsule part and the port should by defaylt have the same name as its type, but with the a lower case of the initial letter, e.g. capsule part typed by MyCapsule should be named myCapsule and port typed by MyProtocol should be named myProtocol.

And yes, as already proposed, a unique suffix should be added in case multiple capsule parts and ports are created type by the same type, i.e. if a second capsule part or port is created then its name should be suffixed with a 2 (and so on).
Comment 2 Remi Schnekenburger CLA 2015-08-26 11:53:43 EDT
Names have the first letter in lower case.
However, we are still not using a suffix to distinguish among several names. This should be updated, and test should be developped according to this rule.
Comment 3 Peter Cigehn CLA 2015-10-09 08:26:34 EDT
I tried to create a port using the new child menu, i.e. right click on a capsule and select UMLRealTime > Port. Then I select and existing protocol in the dialog Edit dialog that pops up.

The problem is that this dialog indicates that the port has already been created. The title of the dialog says "Edit portX" (where X is next availble number). But since the port shall be named according to its selected protocol, the name of any "temporary" port, prior to naming it according to the selected protocol (but with initial small letter) cannot be shown in the title of the dialog. And even after selecting a protocol, the port does not get renamed according to the selected protocol.

Maybe the creation (and naming) of a port when being created using the new child menu needs to be done in a different way, especially considering the needs expressed in Bug 477730, where also the system protocols should be available for easy selection.
Comment 4 Remi Schnekenburger CLA 2016-02-26 08:51:46 EST
still valid for 1.0.0
Comment 5 Christian Damus CLA 2016-05-03 16:50:45 EDT
I have a solution in progress (seemed not to be assigned to anyone and I have been working on port and capsule-part creation scenarios recently).
Comment 6 Eclipse Genie CLA 2016-05-03 17:23:57 EDT
New Gerrit change created: https://git.eclipse.org/r/71955
Comment 8 Christian Damus CLA 2016-05-04 14:11:26 EDT
(In reply to Eclipse Genie from comment #7)
> Gerrit change https://git.eclipse.org/r/71955 was merged to [master].

The default names of ports and capsule-parts are now always their protocol/capsule type name with initial lower case.  In the event that any property of the same name is defined by the capsule, these default names are disambiguated with "2", "3", etc. suffixes as necessary.
Comment 9 Peter Cigehn CLA 2016-05-10 11:47:17 EDT
Verified in the latest Papyrus-RT build that the default naming now works as expected for all the different cases of creating capsule parts and ports: Using the new child menu, drag-and-drop and the creation tool on the palette in the capsule structure diagram. Also checked that a unique suffix is added in case of possible name clashes, i.e. creating a port or capsule part typed by the same type as an existing port/capsule part.
Comment 10 Peter Cigehn CLA 2016-10-20 04:47:47 EDT
Closing as verified fixed.