Specialized Administration > Tailoring Business Objects > Object Initialization Rules Administration > Working with Object Initialization Rules > Object Numbering and Versioning > Creating Numbering Scheme Rule Content > Defining a Generated Value
  
Defining a Generated Value
To define just a generated value, you can use either of the following formats:
<!--this format uses the AttrValue tag to define a generated value as a default value for "number" attribute -->
<AttrValue id="number" algorithm="numbering_algorithm">
<Arg>{GEN:function}</Arg>
</AttrValue>
<!--this format uses the VarDef tag to define a value as a generated value for "gen-number" variable -->
<VarDef id="gen-number" algorithm="numbering_algorithm">
<Arg>{GEN:function}</Arg>
</VarDef>
where:
The out-of-the-box numbering_algorithm is:
com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator
The generator function is specified using the following format:
{GEN: <class> : <key> : <length> : <pad> }
where the following table describes the elements in the function specification:
Element
Description
<class>
Specifies the class whose generateValue method is invoked; this class must implement wt.enterprise.AttributeValueGenerator. The out-of-the-box generator class is wt.enterprise.SequenceGenerator.
<key>
Specifies the key to be passed to the generateValue method as the argument. When using the wt.enterprise.SequenceGenerator class, the key is the name of the database sequence to use. The generator simply assigns the next sequence value.
<length>
Specifies the length of the resulting value; a length of zero indicates that length is arbitrary.
If the generated value is longer than <length>, it is not truncated.
<pad>
Specifies the character used to pad the generated value to the specified length. The default pad character is 0. Changing this character can change the sequence order of the generated number. Do not specify a number other than 0 as the pad character.