attribute including object number

I am trying to add an attribute to my module that displays 'prefix'+'object number'. I have set the prefix and have existing code that adds the Absolute number to the end of it (filled with zeros so that they are all the same length). If I change the absolute number to the object number I get a message that the DXL attribute failed, and that the object number cannot be found. 

 

Does anyone know how to go about creating this attribute - I would like to use it as an identifier since the document the requirements came out of uses these headings as unique IDs.

 

Thanks!


MichelleVill - Tue Sep 19 14:24:29 EDT 2017

Re: attribute including object number
Mike.Scharnow - Tue Sep 19 14:56:31 EDT 2017

it would be easier to answer this when we see your code, then we might see what is wrong.

Not sure whether you really mean "object number" (known in dxl as "number (obj)", there is no attribute "Object Number"), the result being of type string. Perhaps your padding algorithm (take 123, make 000123) takes an integer as argument, not a string.

Re: attribute including object number
MichelleVill - Tue Sep 19 15:09:12 EDT 2017

The object number is built into DOORS as the hierarchical number that is usually automatically filled in when creating a new object. I see that it isn't a system attribute, but it comes up on the list of attribute one can insert as its own column, is there another way to all this number? I changed the type to string as well. 

 

Module mod = current
 
string mod_prefix = mod."Prefix"
string abs_num = obj."Object Number"
string Padded_ID
 
Padded_ID = mod_prefix abs_num ""
obj.attrDXLName = Padded_ID
 

Re: attribute including object number
Mike.Scharnow - Wed Sep 20 02:01:49 EDT 2017

MichelleVill - Tue Sep 19 15:09:12 EDT 2017

The object number is built into DOORS as the hierarchical number that is usually automatically filled in when creating a new object. I see that it isn't a system attribute, but it comes up on the list of attribute one can insert as its own column, is there another way to all this number? I changed the type to string as well. 

 

Module mod = current
 
string mod_prefix = mod."Prefix"
string abs_num = obj."Object Number"
string Padded_ID
 
Padded_ID = mod_prefix abs_num ""
obj.attrDXLName = Padded_ID
 

Hi!

Sorry for not being clear enough.

Instead of 

string abs_num = obj."Object Number"

use

string abs_num = number (obj)

 

Re: attribute including object number
MichelleVill - Wed Sep 20 11:18:38 EDT 2017

ahhhhh

 

Perfect, thank you so much