|Moving a class diagram between packages [message #1781205]
||Fri, 02 February 2018 18:23
| Arun Gupta
Registered: January 2018
Hello Eclipse Forum,|
I am a newcomer to Papyrus, a heavy user of Sparx Enterprise Architect.
Papyrus Diagram, Properties view, General Tab, has "Owner" and "Root Element".
After gendoc didn't generate a document as I expected, I noticed that a diagram dragged, from say Package1 to Package2 changes its Owner from Package1 to Package2, but keeps its Root Element as Package1.
Moreover Package.getPapyrusDiagrams() looks for diagrams whose Root Element is the Package, and not diagrams whose Owner is the Package.
One has to explicitly change the Root Element for a diagram that is moved.
Q1. What is the difference between "Root Element" and "Owner"?
Q2. Why does Acceleo/gendoc go by Root Element and not by Owner?
Q3. Why doesn't the diagram Root Element change properly by itself?
In any case, the intent when putting a diagram in a package is that the diagram will be displayed, printed, etc., as part of the package, so why isn't that the default behavior?
There are likely good reasons behind this, but for someone coming from the aforementioned tool, this is very non-obvious.
I'm using Eclipse Oxygen 4.7.2 Build id: 20171218-0600
Papyrus for UML 126.96.36.199712060842
Thanks in advance for your answers!
|Re: Moving a class diagram between packages [message #1781692 is a reply to message #1781307]
||Mon, 12 February 2018 08:50
| Camille Letavernier
Registered: February 2011
The Owner is the visual container, while the Root element is the element in which new semantic elements will be created. In most cases, they should be similar, but you may want to e.g. have a package listing all your diagrams, for convenience.
When you create a Diagram on a Package P1 and create some elements inside it (Say, P1::C1), moving the diagram to a different package P2 will not move its semantic elements to that another package: the diagram is only moved visually to a different location/container, but it still represents the contents of P1.
Powered by FUDForum
. Page generated in 0.02125 seconds