🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators taggedValueOnFeature
This page was created by Alexandra on 2017-08-13. Last edited by Wikiadmin on 2026-07-29.

You can use taggedValueOnFeature in OCL to read a tagged value from a named attribute or association end in the model; it is intended for expressions that need model metadata rather than an object's ordinary data.

Syntax

Type.taggedValueOnFeature("FeatureName", "TagName")
Part Description
Type The type whose feature metadata you want to inspect.
"FeatureName" The name of an attribute or association end on that type.
"TagName" The name of the tagged value to read from that feature.

The operator returns the tagged value as a string.

Example

Assume that the model contains a type named Thing. Its attribute Attribute1 has a tagged value named MyTag.

Thing.taggedValueOnFeature("Attribute1", "MyTag")

This expression returns the string value assigned to MyTag on Attribute1. For example, if MyTag is set to DisplayName, the expression returns DisplayName.

Use it for feature metadata

Use taggedValueOnFeature when the tagged value belongs to a specific feature of a type:

  • Use an attribute name when the tag is set on an attribute.
  • Use an association-end name when the tag is set on an association end.
  • Supply the feature name and tagged-value name as strings, as shown in the syntax.

For example, if an association end named Customer on Order has the tagged value MyTag, query that metadata on Order:

Order.taggedValueOnFeature("Customer", "MyTag")

Related operator

taggedValueOnFeature reads metadata from a named feature. To read a tagged value without selecting a feature, see taggedValue.

See also