Related Number values all the same...OK?

The enumerations in an enumerated type definition have what the GUI calls:
"Values" and "Related numbers".

For kicks and confusion, in DXL these are referred to:

"codes" and "values" respectively.

 

Typically the "Related number" values for a particular attribute type definition vary, but I have found a case where all the "Related number" values are the same - each enumeration has a Related number of zero.

Is this an issue? What problems might it cause with all-same values?

I am not sure how the number is used, so any clarification would be appreciated.

 


strathglass - Tue Jul 04 13:51:11 EDT 2017

Re: Related Number values all the same...OK?
Mike.Scharnow - Tue Jul 04 16:21:00 EDT 2017

"Values" in enumerations are an optional feature. They can be used for filtering and sorting.

Imagine values for "Priority" named ASAP, Very Urgent, Urgent, Medium, Low, Very Low. These cannot be sorted alphabetically in a meaningful way. You might want to associate the numbers 5,4,3,2,1,0 for those values, respectively. Then you can sort your requirements by values.

 

Or you have release values 7.3, 7.2.1, 7.2.α, 7.2.β, 7.2, 7.1, 7, 6.99. You cannot easily create a filter for "show me all requirements that have been introduced for 7.1 or any 7.2 release". If you associate numbers 73000, 72100, 71991, 71992, 72000, 71000, 69900 with these releases, you can create a filter "release value => 71000 and  <73000".

 

But for "Colour" red, green, white you will rather not find a need to associate any number with them.

Re: Related Number values all the same...OK?
strathglass - Wed Jul 05 10:42:09 EDT 2017

Thanks. Although I guess using this value to sort is far from trivial...you'd have to write a DXL script to extract the value since you can't just grab the value like you can for an attribute.

Re: Related Number values all the same...OK?
Mike.Scharnow - Wed Jul 05 11:30:43 EDT 2017

strathglass - Wed Jul 05 10:42:09 EDT 2017

Thanks. Although I guess using this value to sort is far from trivial...you'd have to write a DXL script to extract the value since you can't just grab the value like you can for an attribute.

Nope. When the related numbers are defined, a simple sort command will automatically use these numbers, e.g.

set ascending "ourRelease"
sorting on 

 

Re: Related Number values all the same...OK?
Mike.Scharnow - Wed Jul 05 11:39:00 EDT 2017

Mike.Scharnow - Wed Jul 05 11:30:43 EDT 2017

Nope. When the related numbers are defined, a simple sort command will automatically use these numbers, e.g.

set ascending "ourRelease"
sorting on 

 

And filters can be created as easily. For sorting and filtering on related numbers, you do not even need DXL, it's just native DOORS behaviour

 

But if you want to create your own sort routine inside a larger script, you are right, you will need an additional step to extract the related numbers, but you can create a skip list containing the related numbers and use this for getting the sort value, should not be too complicated.