The UML2 adapter identifies elements of UML models as traceable artifacts. UML models are configured as UML2 data access. UML elements are identified based on their metatypes, their assigned stereotypes, or their namespaces. For example, you might want to recognize only artifacts of type Class with stereotype «SafetyRelevant» that are in the safety package.
This adapter supports selection propagation: If you select an element in ANALYZE, the selected artifact will be opened in Eclipse’s UML model editor, and if you select an element in the UML model editor, it will be opened in ANALYZE.
Open the ANALYZE configuration with the ANALYZE configuration editor, and add a new data access as described in section "Data accesses". Select UML2 as data access type.
Supported options:
Example:
resource *.uml
This configuration specifies that ANALYZE should load all files residing in the workspace whose filename extension is .uml.
Please note that this adapter supports files with .uml filename extension only.
Open the ANALYZE configuration with the ANALYZE configuration editor, and add a new artifact type as described in section "Artifact types". Select your previously-configured Eclipse UML2 data access in the Data access drop-down list.
Example:
name valueOf("qualifiedName")
subset namespace model
subset metatype uml.Operation
subset metatype uml.Class
map {
attr to valueOf("isLeaf")
}
This example shows an artifact type configuration for the UML2 adapter. It provides all classes and operations in the
model namespace that are residing in the
uml package. Extracted artifacts are named according to their respective
qualifiedName attribute. The custom attribute
attr is mapped to the value of the
isLeaf attribute of the matched element. Instead of explicitly specifying identifiers like
model
, you can also construct these identifiers by using complex string expressions. Within these, you can refer to attributes of UML elements via the
valueOf keyword.
The Eclipse UML2 artifact type configuration supports the following keywords:
to
expression, where
attribute is the attribute name, and
expression defines how the assigned value is computed.
Content assist will show you a list of available stereotypes and metatypes, where appropriate. Place the text cursor right from
subset metatype or
subset stereotype, leave at least one space, and press [Ctrl]+[Space]
.
Please note that the configuration supports using the same keyword multiple times. For example, the expressions subset metatype uml.Class and subset metatype uml.Operation in the same configuration means "all Class or Operation elements in the uml package".
An artifact’s version is used for suspicious links validation. The version of an artifact of this type is the URI of the element.
Relationships within a UML model can be interpreted directly as trace links. ANALYZE derives trace links based on UML relationships and their navigability.
Open the ANALYZE configuration with the ANALYZE configuration editor, and add a new link type as described in section "Configuring a link type".
Mapping example:
subset metatype uml.Association
subset metatype uml.DirectedRelationship
map {
attr to valueOf("Navigable")
}
This example shows a link type configuration for the UML2 adapter. It extracts all Association and DirectedRelationship elements that are residing in package uml as trace links. The custom attribute attr of these links is mapped to the value of the Navigable attribute of the matched element.
The Eclipse UML2 link type configuration supports the following keywords:
to
expression, where
attribute is the attribute name and
expression defines how the assigned value is computed.
Content assist will show you a list of available metatypes, where appropriate. Place the text cursor right from
subset metatype, leave at least one space, and press [Ctrl]+[Space]
.
Please note that the configuration supports using the same keyword multiple times. For example, the expressions subset metatype uml.Association and subset metatype uml.DirectedRelationship in the same configuration means "all Association or DirectedRelationship in package uml.
A link’s version is used for suspicious links validation. The version of a UML2 link contains the relationship’s URI in the UML model, but we have to differentiate between two cases: