Customization > Extensibility Through Profiles, Stereotypes, Tag Definitions and Scripts > Advanced extensibility through stereotype scripts and script items > Deriving tagged values through derived definitions > Overview of deriving tagged values through derived tag definitions
  
Overview of deriving tagged values through derived tag definitions
When the Tag Definition is applied to a Model item through a Stereotype, its tagged value is typically set by a user; however, you can create derived Tag Definitions. The tagged value of a derived Tag Definition is derived through the Tag Definition's derivation script. A derivation script can interrogate item properties and linked items, and then set the tagged value accordingly.
To create a derived Tag Definition, you select the Derived check box on the Type tab of a Tag Definition's Property Pages, and then specify the derivation script on the Derivation Script tab:
For a Tag Definition whose type is Reference, the script can return any items and diagrams in the model. The items and diagrams do not have to be set up as valid model item types for the Tag Definition.
For a Tag Definition whose type is Boolean, Enumeration or Text, the script can return any plain text. The text is not validated against possible Boolean or Enumeration values.
* 
A Derivation Script must not make any changes to a Model.
A derived Tag Definition's derivation script is run under the following circumstances:
When the tagged value is first read.
When the tagged value is read inside a transaction.
When the tagged value is read after the object that owns it has been released by the Modeler user interface.
When the tagged value is read after something the script depends on has been changed in the current process – under these circumstances, the tagged value is reevaluated, and then the derivation script is run only when necessary.
When something the derivation script depends on is changed in the current process, the value is reevaluated.
* 
If a derivation script is complex and affects performance, you may want to consider running the script on demand through a menu command.
For more information about working with VisualBasic scripts for a derivation script, see Script functions, attributes and objects - derivation scripts for tag definitions.