Can't create an Association as a child of the root model element [message #1820688] |
Sun, 26 January 2020 21:58 |
Olivier Cailloux Messages: 43 Registered: July 2009 |
Member |
|
|
In the Model Explorer view, right-clicking on the root model element and navigating to the New Relationship sub-menu, I do not see "Association" there.
I expected to be able to create an Association from that sub-menu, given that I can create an Association from many other kinds of elements. There seems to be no reason to disallow it as a child of the root element, especially considering that such an association can be created by other means (e.g., graphically, in a diagram). I also found no reason in the UML specification to disallow having an Association as a child of the root model element, though of course I may have missed it.
Is there any reason to forbid having an Association as a child of the Root element? Is there a way of creating it without using a diagram? (I like to create all elements in the model before switching to the diagram, when teaching UML.)
I did not find closely related known bugs when searching for "relationship"; possibly vaguely related are bug 468392 which talks about applying the standard profile; bug 473140 which says that some associations have restrictions on their ends; and bug 425565 which says that certain entries in the Relationship menu are missing (but the bug is reported solved).
[Updated on: Sun, 26 January 2020 23:28] Report message to a moderator
|
|
|
Re: Can't create an Association as a child of the root model element [message #1820700 is a reply to message #1820688] |
Mon, 27 January 2020 08:54 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Olivier,
The "Create Relationship" menu is intended to create a relationship from/to the selected element; but associations can't be created from/to a Model (Or a Package). The owner of the association is chosen as a second step, IIRC.
The "Create Child" menu, however, might contain the Association element for Models/Packages (Unless it was hidden, to reduce cluttering)
So you have 2 ways to create an Association in the root model:
- Right click on the source classifier, New relationship, Association, then select the target classifier (And then, maybe, select the owner of the association? I'm not sure if that's an option)
- Or right click on the owner (Model/Package), New child, Association, and then configure the association source and target manually (By creating the association ends and setting their types). This is not really recommended, as typing associations manually can be cumbersome; so Papyrus may have disabled this option.
In any case, after creating the association, you can easily move it to the desired parent (Package or Model) via drag & drop.
HTH,
Camille
Camille Letavernier
|
|
|
Re: Can't create an Association as a child of the root model element [message #1820821 is a reply to message #1820700] |
Wed, 29 January 2020 16:08 |
Olivier Cailloux Messages: 43 Registered: July 2009 |
Member |
|
|
Thanks a lot for this clarification.
Then my (new) problem is that I am hitting bug 473140. I just voted and added a comment to the bug, I hope it will get some attention...
Apart from that bug, I also observe that when an Association gets created by editing a diagram (by drawing a graphical association item between the corresponding classifiers), the properties view of the Association shows two Member Ends that can be edited. But when creating an Association through the Model explorer as you suggested, say, from a Class to another Class, the Properties view of the Association (the UML tab) only shows "Name", "Label" and "Visibility", no Member Ends. Is this expected? I find it handy to be able to edit member ends after the fact, or at least, to be able to view them.
[Updated on: Thu, 30 January 2020 09:58] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03889 seconds