How does RTC determine literal id for a custom enumeration attribute?
RTC 4.0.5 used.
The user add enumeration attribute with some values and the configuration source will show
<enumeration attributeTypeId="ErrorCategoryEnum" name="Item">
<literal default="true" id="ErrorCategoryEnum.literal.l2" name="item1"/>
<literal id="ErrorCategoryEnum.literal.l4" name="item2"/>
<literal id="ErrorCategoryEnum.literal.l6" name="item3"/>
<literal id="ErrorCategoryEnum.literal.l8" name="item4"/>
In another project, when adding similar Item enumeration attribute, it will show
<enumeration attributeTypeId="ErrorCategoryEnum" name="Item">
<literal default="true" id="ErrorCategoryEnum.literal.l1" name="item1"/>
<literal id="ErrorCategoryEnum.literal.l2" name="item2"/>
<literal id="ErrorCategoryEnum.literal.l3" name="item3"/>
<literal id="ErrorCategoryEnum.literal.l4" name="item4"/>
Since there is an external program to check with literal id, they want to make them consistent. There are manual way to change literal id in the configuration source etc. The question here is:
How does RTC determine the literal id for the custom enumeration attribute as it does not make sense it assign
sequential id in one PA but even id in another one? Thanks
The user add enumeration attribute with some values and the configuration source will show
<enumeration attributeTypeId="ErrorCategoryEnum" name="Item">
<literal default="true" id="ErrorCategoryEnum.literal.l2" name="item1"/>
<literal id="ErrorCategoryEnum.literal.l4" name="item2"/>
<literal id="ErrorCategoryEnum.literal.l6" name="item3"/>
<literal id="ErrorCategoryEnum.literal.l8" name="item4"/>
In another project, when adding similar Item enumeration attribute, it will show
<enumeration attributeTypeId="ErrorCategoryEnum" name="Item">
<literal default="true" id="ErrorCategoryEnum.literal.l1" name="item1"/>
<literal id="ErrorCategoryEnum.literal.l2" name="item2"/>
<literal id="ErrorCategoryEnum.literal.l3" name="item3"/>
<literal id="ErrorCategoryEnum.literal.l4" name="item4"/>
Since there is an external program to check with literal id, they want to make them consistent. There are manual way to change literal id in the configuration source etc. The question here is:
How does RTC determine the literal id for the custom enumeration attribute as it does not make sense it assign
sequential id in one PA but even id in another one? Thanks
Accepted answer
For what it is worth, I did a quick test and found that enumerations added in the web GUI had the sequential literals, while in the Eclipse client even-numbered. Can't really say why the two clients behave differently. I'm using RTC 4.0.6.
So if it is designed this way and you want sequential literals, add the enumerations in the web GUI, not the Eclipse GUI.
So if it is designed this way and you want sequential literals, add the enumerations in the web GUI, not the Eclipse GUI.
2 other answers
The ID value can be changed, but any work items that are using that literal value will actually show the ID in the associated attribute, not the name. If you really want to go that route I suggest the following
- Change the name on the enumeration literals whose ID you are going to "retire" to a value with an eye-catching string (e.g. DoNotUse+original name)
-
In RTC Eclipse: Add new literals with the name you want using the UI, then before saving the configuration switch to the Configuration source and change the ID value to the one you want to end up with, save the project configuration.
- Change existing work items with the old enumeration values to the corresponding new value
- Remove the old enumeration literals.