Page 1 of 1

Attributes through Stereotypes and their instances.

PostPosted: Tue Sep 05, 2017 2:25 pm
by 543SysML
I am attempting to extend <Block> and define <hardware> and <software> stereotypes defined in order to maintain a set of attributes associated with each stereotype.

I can create a profile, create and apply stereotypes on blocks but looking to get answers on the following questions.

1- If I create a <block> and then stereotype it by <software> or <hardware>, both stereotypes are visible. Now, if I assign a value to one of the attributes of the stereotype. The <block> stereotype disappears and also changes its icon in the containment menu? Can this behavior be explained? is it possible to keep both stereotypes on the element? Is it possible for the containment menu icons to not switch their shape?

2- My biggest issue is with understanding why attributes defined for the stereotype do not make it to the instances of a hardware or software block.

I have attached a sample project that shows the issues I am running into. Perhaps, I have misunderstood something and not using the tool or the language properly.

Thanks,

Re: Attributes through Stereotypes and their instances.

PostPosted: Wed Sep 06, 2017 1:15 am
by Rolandas
Hello,

As you extended your stereotype from Block, but did not extend it's customization, after you applied property the Block is removed and your style take precedence and as it's not defined or extended the icon changes.
I attached your modified sample with extended Customizations. Please check it. And it should work now the way you want.

Regards,
No Magic Support Team

Re: Attributes through Stereotypes and their instances.

PostPosted: Wed Sep 06, 2017 7:46 am
by 543SysML
Thank you very much, I did not realize I can also extend the Customization Element and apply multiple customization to an element.

My second question however remain unanswered, How come the instance of the <hardware>/<software> block does not have the ability to set its <hardware> specific attributes? i.e. Once I have created an instance of <hardware> block, I would like to be able to set its attribute values such as "Asset Tag", "Device Name" etc.

Re: Attributes through Stereotypes and their instances.

PostPosted: Wed Sep 06, 2017 8:05 am
by Rolandas
Hello,

Sorry somehow i missed your second part.
Instances define Classifiers, not stereotypes. So you need properties (attributes in your Blocks) to be able to specify in Instances.

So in your case, you would need a Block called Hardware with attributes that you need. Then you extend your other blocks from it and then initialise your instance with extended Block or Hardware block.


Regards,
No Magic Support Team