What I want to achieve are multiple stereotypes of a requirement element, sharing some tagged values but having a unique value as well. Users should be able to change the stereotype of an existing element if they realise that it should be a different type, retaining the tagged values entered.
Initially I defined each stereotype individually (extending each from the Requirement metaclass), but when the stereotype of an existing element is changed then all the entered values for each Tagged Value is lost.
Secondly, I used one stereotype as a base and then used «redefines» for the others. This worked to retain tagged values entered, but for a Tagged Value with the same name on the redefining stereotype (where I also define an initial value on each defined stereotype), the result is TWO tagged values on elements, with the same name, but different values (when the stereotype is changed on an existing element).
My base stereotype is named UR, with an Attribute named "Category" and Initial Value "Functional"; one of my redefined stereotypes is named "URNF", with an Attribute named "Category" and Initial Value "Non-Functional". When I change an initial Functional requirement to Non-Functional, the element has two tagged values, Category = Functional and Category = Non-Functional!
What I would have expected is that a redefined stereotype would have REPLACED an existing Tagged Value with the same name, not added a second one - Am I correct in this assumption? If so, then it's a bug, but I might be wrong in my assumption.
Thirdly, I tried creating a stereotype as a base, without Tagged Values that need to be unique (in the above example, without Category), redefining all my desired stereotypes. This works, but also leaves the base stereotype selectable by users. I have not found any way that a stereotype defined in the MDG can be hidden - is there any way that I could achieve that? If there is a way to hide a stereotype from being available after redefining then this is a workaround - I do also have the _metatype attribute defined on all of my stereotypes.
I have deviated slightly from the Sparx guidance on using «redefines» - the instructions are to give the redefining stereotype the same name as the base, but obviously I want different stereotypes, so I have given them different names. As a final option, I did try my third option, with the same name on both the base and the redefined stereotype, but the extra Tagged Value in the redefining stereotype was missing (it looks like the redefinition in this case got ignored).