See the following procedures for custom View Creation dialog and submenu creation.

Updating the View Creation dialog/submenu

Once you have created the new View Creation dialog/submenu, activate it via the (2026x Refresh1) Activating View Creation dialog.

The default name for the View Creation dialog's invocation command is Create View. If you create a dialog from scratch and do not set a new name for the command, the default name remains.

Creating a custom View Creation dialog/submenu

To create a custom View Creation dialog/submenu


  1. In the Containment tree, create a new root namespace.
  2. Open the Textual Editor for the new namespace.
  3. In the Textual Editor, create a package and name it.
  4. Within the body of the package, declare a part definition, specify the name for the dialog instance, subclassify the ViewCreationDialog definition from the DS_UIComponents::CoreUIComponents::Dialogs package, then, within the body of the definition:
    1. Manage the View Creation dialog/submenu command categories 
    2. Manage the View Creation dialog/submenu commands
  5. Click the Synchronize button.

package CustomViewCreationDialogs {
   part def NewCustomViewCreationDialog :> DS_UIComponents::CoreUIComponents::Dialogs::ViewCreationDialog { // naming the new dialog instance and subclassifying the ViewCreationDialog
   }
}

Managing the View Creation dialog/submenu command categories

Creating view creation command categories for the View Creation dialog/submenu

To create view creation command categories for the View Creation dialog/submenu


  1. Within the body of the part definition element of the new View Creation dialog instance, declare a part usage, name it (optional), then subset the itemCategories element.
  2. Click the Synchronize button.

package CustomViewCreationDialogs {
   part def NewCustomViewCreationDialog :> DS_UIComponents::CoreUIComponents::Dialogs::ViewCreationDialog
      part customSysMLViewsCategory :> itemCategories; // adding a command category
   }
}

Specifying the view creation command category attributes for the View Creation dialog/submenu

To specify the view creation command category attributes for the View Creation dialog/submenu


  1. Place the cursor within the body of the new command category's element and redefine the inherited attributes that you want to modify with the needed values.
  2. Click the Synchronize button.

package CustomViewCreationDialogs {
   part def NewCustomViewCreationDialog :> DS_UIComponents::CoreUIComponents::Dialogs::ViewCreationDialog
      part customSysMLViewsCategory :> itemCategories {
         attribute :>> isCollapsed default true; // specifying the command category's default collapse state
         attribute :>> label default "SysML v2 Symbolic Views"; // specifying the command category's name
      }
   }
}

Managing the View Creation dialog/submenu commands

You can customize the View Creation dialog/submenu content by specifying which view creation commands it should contain. The view creation commands themselves are created by targeting view templates (e.g., generalViewTemplate, etc.). There can be two types of templates:

  • predefined templates. These templates are available via the DS_UIComponents::UIComponents::ViewsTemplates, which contains predefined templates for all standard predefined view definitions (symbolic and tabular). 
  • custom templates. You need to create custom view templates for any custom-created view definitions (e.g., custom symbolic view definitions) if you want their corresponding view creation commands to be available in the View Creation dialog/submenu.

Adding view creation commands to the View Creation dialog/submenu command categories

To add view creation commands to the View Creation dialog/submenu command categories


  1. Within the body of the command category's element, declare a part usage defined by DS_UIComponents::CoreUIComponents::Dialogs::DialogItem and subset abstractItems. This element instantiates the new command.
  2. Within the body of the new command's instance, specify the command's name by redefining the label attribute with the new view creation command name.
  3. Within the body of the new command's instance, declare a perform action usage defined by DS_UIComponents::CoreUIComponents::Operations::OperationFromTemplate and redefine operation. In the element's body, specify the in direction based on the view template you want to use for the command using a metaclassification expression.

    Alternatively, you can also use MetadataAccessExpression, e.g., when the templated view is named. See the textual notation example below.

  4. Click the Synchronize button.

package CustomViewCreationDialogs {
    part def CustomViewCreationDialog :> DS_UIComponents::CoreUIComponents::Dialogs::ViewCreationDialog {
        part customSysMLViewsCategory :> itemCategories {

            // view creation command by targeting a custom view template:
            // (metaclassification expression is used to target an unnamed templated element in a package)
            part reqViewItem : DS_UIComponents::CoreUIComponents::Dialogs::DialogItem :> abstractItems { // new view creation command instance
                attribute :>> label default "Custom Requirements View"; // specifying the command's name
                perform action : DS_UIComponents::CoreUIComponents::Operations::OperationFromTemplate :>> operation { // specifying the view template that should be targeted upon the clicking of the new command
                    in ref = (customRequirementsViewTemplate meta KerML::Package).ownedElement; // the specified template is an unnamed custom view template, see the procedure 'Creating view templates for custom templated view creation commands'
                }
            }

            // view creation command by targeting a custom view template:
            // (MetadataAccessExpression is used to target a named templated element)
            part reqViewItem2 : DS_UIComponents::CoreUIComponents::Dialogs::DialogItem :> abstractItems { // new view creation command instance
                attribute :>> label default "Custom Requirements View 2"; // specifying the command's name
                perform action : DS_UIComponents::CoreUIComponents::Operations::OperationFromTemplate :>> operation { // specifying the view template that should be targeted upon the clicking of the new command
                    in ref = 'Custom Requirements View 2'.metadata; // the specified template is a named custom view template, see the procedure 'Creating view templates for custom templated view creation commands'
                }
            }

            // view creation command by targeting a predefined view template:
            part gvButton : DS_UIComponents::CoreUIComponents::Dialogs::DialogItem :> abstractItems { // new view creation command instance
                attribute :>> label default "General View"; // specifying the command's name
                perform action : DS_UIComponents::CoreUIComponents::Operations::OperationFromTemplate :>> operation { // specifying the view template that should be targeted upon the clicking of the new command
                    in ref = (DS_UIComponents::UIComponents::ViewsTemplates::generalViewTemplate meta KerML::Package).ownedElement; // the specified template is a predefined view template from DS_UIComponents::UIComponents::ViewsTemplates
                }
            }

        }
    }
}

Creating view templates for custom templated view creation commands 

To create view templates for custom templated view creation commands 


  1. Within the body of the new dialog instance's package, create a new package for the custom view template.
  2. Within the package, declare a view usage defined by the custom view definition.
  3. Click the Synchronize button.

package customRequirementsViewTemplate { // the new template's package, which you will have to target using the OperationFromTemplate to create a view creation command for the custom element; use metaclassification expression to target it
    view : CustomRequirementsView::'Requirements View';  // the new unnamed templated element (a view defined by elsewhere declared CustomRequirementsView::'Requirements View')
}

view 'Custom Requirements View 2' : CustomRequirementsView::'Requirements View'; // the new named templated element (a view defined by elsewhere declared CustomRequirementsView::'Requirements View'); use the MetadataAccessExpression to target it