Last Updated:

Defining Custom Add New Menus on Stereotypes

Andy Lapping Tip

Custom Add New Menus

As you may already know, when creating profiles the Add New menu may be customized by setting the AddNewMenuStructure property on a new-term stereotype applicable to the project. But did you know that it can also be customized for any stereotype ? 

An example of this can be seen by creating a project with the SysML perspectives loaded. The default Getting-Started perspective offers custom Add New menus for each of it's autmatically-created packages:

So how does it work ? 

It's actually pretty simple, all you need to do is set the AddNewMenuStructure property on your stereotype - exactly as you would on a project strereotype. The Getting-Started perspective by the way is simply hiding the stereotypes. If we use the browser display options to show them then the model looks like this:

So that's all there is to it ? 

Not quite. The AddNewMenuStructure property does not appear in the Properties panel for regular stereotypes - only for new terms. So to set the value you can either:

  1. Make the stereotype a new term temporarily, set the property value and then switch off the new term. 
  2. Set the property value in a prp file

Simple as that !