Main Content

Customize Links with Custom Attributes

When you create a link set using Simulink® Requirements™, you can create custom attributes that apply to the links contained in the link set. Custom attributes extend the set of properties associated with your links.

Define Custom Attributes for Link Sets

To define a custom attribute for a link set:

  1. Open the Requirements Editor. At the MATLAB® command prompt, enter:

    slreq.editor

  2. Open a requirement set that contains requirement links, or create a new requirement set and create requirement links. For more information, see Requirement Links.

  3. From the View menu, select Links.

  4. Select the link set.

  5. In the right pane, under Custom Attribute Registries, click Add to add a custom attribute to the link set.

  6. The Custom Attribute Registration dialog box appears. Enter the name of your custom attribute in the Name field. Select the type from the Type drop-down menu. Optionally, enter a description of the custom attribute in the Description field.

Custom Attribute Types

There are four custom attribute types:

  • Edit: Text box that accepts a character array. There is no default value.

  • Checkbox: Single check box that can be either checked or unchecked. The default value is unchecked.

  • Combobox: Drop-down menu with user-defined options. Unset is always the first option in the drop-down menu and the default attribute value.

  • DateTime: Text box that only accepts a datetime array. There is no default value. See datetime for more information on datetime arrays.

Set Custom Attribute Values for Links

After you define custom attributes for a link set, you can set the custom attribute value for each link. Select the link in the Requirements Editor. In the right pane, under Custom Attributes, enter the desired value in the field.

Note

You can only set the custom attribute value for one link at a time.

If you do not define a value for Checkbox or Combobox type custom attributes for a link, the value will be set to the default. For Checkbox custom attributes, the default value is defined in the Custom Attribute Registries pane for the link set. For Combobox custom attributes, the default value is always Unset.

Edit Custom Attributes

After you define a custom attribute for a link set, you can make limited changes to the custom attribute. Select the link set in the Requirements Editor. In the right pane, under Custom Attributes Registries, select the custom attribute you want to edit and click Edit.

For custom attributes of any type, you can edit the name and description. For Combobox custom attributes, you can also edit the drop-down menu options. You can edit the value of each option in the drop-down menu (excluding Unset), or add and remove options. If you edit the value of an option or remove an option, then any links that had been set to that option will be reset to the default value, Unset.

After you set the custom attribute value for a link, you can change the value at any time by selecting the link in the Requirements Editor and setting the updated value in the Custom Attributes pane.

Related Topics