Before starting transformation you have to create transformation mapping rules.
To create mapping rules you need to create Dependency relationship between elements you want to transform.
Mapping rules can be created (dependency relationship can be created) between the following elements:
- Stereotypes
- Tags
- Types
Creating mapping rules for Stereotype transformation
This type of transformation is used to replace Stereotype.
To create Stereotype transformation mapping rule
- Create Dependency relationship between Stereotypes which you want to transform.
- Apply ReplaceStereotype stereotype to Dependency.
- Perform transformation.
Tag values of old stereotype are preserved when tag name and type of tag value is the same. For tag values with different names create mapping rule for tag transformation.
ReplaceStereotype stereotype has the following tags:
- disableNewTypeCreation tag. By default false. Set this tag to true if you do not want to perform transformation when target and source metaclasses are not compatible. For example, if you do not want that Class would be changed to Use Case.
- disableReplaceWhereSaveAsElementValue tag. By default false. Set this tag to true if you do not want that stereotype would be changed where it is used as Tag value (tag value is stereotype itself, for which you perform transformation).
Creating mapping rules for Tag transformation
This type of transformation is used to replace Tag (when tag names differs). For example, source stereotype has author Tag and target stereotype has name Tag.
To create Tag transformation mapping rule
- Create Dependency relationship between Tags which you want to transform.
- Apply ReplaceTaggedValue stereotype to Dependency.
- Perform transformation.
To create mapping rule correctly, you have to create Dependency relationship not only between Tags, but also between Stereotypes of these tags (see mapping between stereotypes, which is described above).
Creating mapping rules for types transformation
This type of transformation is used to replace type. For example, to replace type of Attribute.
To create types transformation mapping rule
- Create Dependency relationship between Types which you want to transform.
- Apply ReplaceType stereotype to Dependency.
- Perform transformation.