Name generator mechanism

  
In scenarios where many new object instances are being created, there is an additional IRM feature called Name Generators that enables automatic name generation for those new instances. The feature enables configuring Name Generator objects, which are essentially custom name templates which can be used in different batch naming operations. The feature captures the state of the batch naming-enabled fields - Name, Alternate Name, Numerical Index, and Alpha-numerical Index -- so that the same user, or potentially other users can automatically create non-duplicate names. 
 
The feature is administered through a central Name Generator Manager dialog, which enables Name Generator objects for each Super Category to be created and viewed. Note that name generators cannot be edited, because doing so would compromise the sequence of names generated. The dialog can be accessed from the Managers menu button in the main screen's function bar:
 
 
Name Generator Manager
The dialog consists of two main parts:
  • a list of Super Categories on the left; selecting a different Super Category changes the content of the right part of the dialog
  • a data grid listing all of the Name Generators for the selected Super Category
 
IRM supports Name Generators for the Super Categories shown in the screenshot image, with the exception of Tickets, which are not Super Categories. For these types of objects, the appropriate object creation dialogs show add a drop-down list of Name Generators for that Super Category, along with "None" shown for selection:
  • If None is selected, the existing Name string field is enabled, otherwise it's disabled.
  • If a Name Generator is selected, its Name Template is shown in the Name string field.
 
When the dialog is entered, whichever Name Generator is set as Default is automatically selected in the dropdown. If there is no Name Generator defined for that Super Category, then None is automatically selected (this latter situation holds if there is no Name Generator at all).
 
Note that this enables the user to establish a standard Name Generator for each of the applicable Super Categories and have that used by default. The idea is to make it easy to instill some object naming discipline on the users, while still maintaining flexibility. This is why the selection of a default Name Generator is not a per-user setting, it's shared across all users.  
 
 
Additional buttons in the dialog enable adding or removing a Name Generator from the list:
removes an existing Name Generator from the grid, but is enabled only for the owner of the Name Generator object
 
- creates a new Name Generator; click on it  opens a pop-out sub-dialog that enables specifying the batch naming fields, along with the name of the Name Generator:
 
The Name Generator's fields are all editable at the of creation, but are read-only afterwards. The fields are as follows:
  • Generator Name - just a name for this name generator
  • Index Type
  • If set to Numeric, “Starting Value” only allows numbers and the templates disallow the @ char
  • If set to Alphabetic, “Starting Value” only allows alphabetic characters and the templates disallow the # char
  • If the radio button is changed, “Starting Value” is cleared and the templates are stripped of any incompatible @ or # chars
  • Name Template - a string that has a single sequence of # characters in it, which can be preceded or followed by @ characters (but not both). When the generator produces a new name, the # and @ characters are replaced with a corresponding number of digits or letters for the current index value, and the index value is incremented.
  • Alternate Name Template - another template, for the alternate name of the object being named. The rules for # and @ work the same as for the Name Template. For the values used in the above dialog, the first Name will be "Equipment-A001" and the first Alt Name will be "Eq-A001" (note that the same index value is used for both).
  • Starting Value - index value to start the sequence with. It is used for both alpha and numeric values (0=A, 1=B, etc.).
  • Default for <Super Category> - the <Super Category> is Equipment, Cable, or whatever the Super Category is currently selected for the Name Generator
     
    Important: If the user attempts to Save and the templates do not have any # or @ chars, the Save button is disabled
     
    Additional rules apply when editing an existing Name Generator:
  • An additional field “Current Value” displays the current value of the counter. This field is disabled in create mode, but in edit mode it can be used to change the current value to a larger value.
  • In edit mode, the only fields that can be changed are “Current Value” and “Default for <superCat>”
     
     
     
    Some general naming rules
     
    For "##" the generated sequence is "00, 01, 02, ... 99, 00, ..."
    For "#@" the generated sequence is "0a, 0b, ... 0z, 1a … 1z, 2a ..."
    For "@@#" the generated sequence is "aa0, aa1, ... aa9, ab0, ..."
     
    For example, if the Starting Index = 2:
  • for "@#" the sequence will be "a2, a3, ..."
  • for "#@" the sequence will be "0c, 0d, 0e, ..."
 
 
Additional caveats
 
To use a Numeric Index the '#' symbol is used in the Name Template as a placeholder where the Numerical Index is substituted. The width of the incrementing number is limited to how many '#' chars are there.
 
For example, if you set the Numerical index as '9', quantity at 5 and enter only a single '#', the ID wraps around to '0','1' etc. In this case a standard warning pop-up dialog opens indicating the index has been exhausted. The same warning appears in case with 'Alphabetic Index' going from Z to A.
 
To use an Alphabetic Index the '@' symbol is used in the Name as a placeholder where the "Alphabetic Index" is substituted. If a single '@' is entered in the Name, for example, to create 4 equipment instances, and the "Alphabetic Index" entered is '8', you will end up getting the first entry as 'blank' in place of the '@' symbol, the '8', then 'A', then 'B'. So a Number is allowed to be entered into the 'Alphabetic Index' field, but it is considered more of an Alpha-numeric index and the resulting instances are numbered '8', '9', 'A', 'B'.
 
It is wise to avoid providing too few characters, because if the entire name "wraps" around, duplicate names will be produced which is generally undesirable. On the other hand, if more than one sequence of "#" and "@" chars appears in the template, the same values will appear multiple times, which is usually not useful.
 
Any dialog that allows creation of more than one object enables selecting an existing Name Generator, or entering the Name Generator Manager to create a new one, as displayed in the sample screenshot below for the Duplicate dialog (explained in more detail in the next topic):
 
After a Name Generator is selected, the appropriate Name and Alternate Name fields in the dialog are automatically filled out with the current values from the Name Generator, but those fields are note editable then and can be changed only by selecting another Name Generator, or none, from the previous drop-down menu: