Attributes through Stereotypes and their instances.

Discussions about Domain Specific Language customizations

Moderator: Moderators

Attributes through Stereotypes and their instances.

Postby 543SysML » Tue Sep 05, 2017 2:25 pm

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,
You do not have the required permissions to view the files attached to this post.
543SysML
Forum Newbie
Forum Newbie
 
Posts: 19
Posts Rating:1
Joined: Thu Apr 13, 2017 1:00 pm

Re: Attributes through Stereotypes and their instances.

Postby Rolandas » Wed Sep 06, 2017 1:15 am

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
You do not have the required permissions to view the files attached to this post.
Rolandas
Customer Support
Customer Support
 
Posts: 226
Posts Rating:16
Joined: Mon Jul 30, 2012 3:59 am

Re: Attributes through Stereotypes and their instances.

Postby 543SysML » Wed Sep 06, 2017 7:46 am

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.
543SysML
Forum Newbie
Forum Newbie
 
Posts: 19
Posts Rating:1
Joined: Thu Apr 13, 2017 1:00 pm

Re: Attributes through Stereotypes and their instances.

Postby Rolandas » Wed Sep 06, 2017 8:05 am

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
Rolandas
Customer Support
Customer Support
 
Posts: 226
Posts Rating:16
Joined: Mon Jul 30, 2012 3:59 am


Return to DSL

Who is online

Users browsing this forum: No registered users and 0 guests