|
Re: How to inherit attributes in class/block diagram using Eclipse Papyrus? [message #1852416 is a reply to message #1852414] |
Sun, 15 May 2022 16:12 |
|
Hi James,
the standard UML way. Connecting two uml:Class elements with a uml:Generalization the uml:Class element on the client end inherits the attributes from the uml:Class element on the provider end. A sysml:Block is merely a uml:Stereotype applied on uml:Class. Consequently the some applies for blocks.
That also works over several uml:Generalization relations, like A defines some attributes, A generalizes B, B generalizes C. The C also inherits from A.
The attributes are not rendered within a diagram by default, but you can drag'n'drop them from the model explorer if you want them showed.
Works like that at least since Papyrus version 0.7 ;-)
/Carsten
PS Martin-Harris Construction ???
[Updated on: Sun, 15 May 2022 16:24] Report message to a moderator
|
|
|
Re: How to inherit attributes in class/block diagram using Eclipse Papyrus? [message #1852437 is a reply to message #1852416] |
Mon, 16 May 2022 14:41 |
James Miranda Messages: 3 Registered: May 2022 |
Junior Member |
|
|
Hi Carsten!
First of all, thank you for your quick response and for your help.
However, I believe that my question without the images and links was a little bit tricky. Sorry for this inconvenience.
I'm not having a problem with generalization between two UML classes. Instead, I'm having problems with my class attributes being filled when I tried to represent my instances.
I'll try to describe my current Papyrus model even without images and hope that it clears my problem a little bit.
I have a uml:Class named "Book" with two attributes "author" which is an EString and "numberOfChapters" which is an EInt. I created it inside a block definition diagram (bdd).
I'm able to create another class "Magazine" that inherits the attributes from "Book" without problems, for example. Following your explanation, I'm able to render these attributes in Papyrus.
After finishing my work with my classes, I created an internal block definition (ibd) and inside this diagram, I created an Instance block (using the "Part" element from the Pallete) that is an instance of my "Book" class. Now, I'm not able to render my "author" and "numberOfChapters" in my diagram, but I'm also not able to fill out these properties (with some values like "James Joyce" for the "author" and 40 for the "numberOfChapters", for example). I have a block "Ulysses:Book[1]" in my ibd without any rendered attributes.
Maybe I used the wrong terms in my question, but I'm trying to represent my SysML instances with filled attributes in my ibd. Do you know if it is possible to do it using Papyrus?
As I said before, I'm not able to post images here, but if you search the exact same title on the StackOverflow site, I posted the exact same question (before my discovery about these Eclipse forums) with some images from my actual Papyrus instance.
PS: I didn't get it. This message was for me too?
[Updated on: Mon, 16 May 2022 14:47] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04147 seconds