Dear Patrick,
the instance name generation function is effective for those classes which own an instance attribute __NameGeneration__ of type STRING. It can be executed by selecting the menu item "Edit" - "Update object attributes" - "Generate object names".
The name generation is just taking a specified reference attribute value and assigning it as the new instance name. This is done for all instances of classes which have a name generation definition. If the reference attribute is of type INTERREF an output format can be specified. So just the object name of an inter-model reference could be assigned. The reference attribute and the output format are specified in the attribute's default value (attribute value of class).Sometimes the user gives his own names to objects and does not want them to be overwritten. For the reason of recognizing if a name was generated or has been choosen by the user the name which was generated at last is saved in __NameGeneration__ of each instance. If the current instance name differs from the last name the instance name keeps unchanged.
The syntax of the language for the generation of instance names is based on the following grammar:
NameGenDefinition : NAMEGEN srcattr:attrName [
format:outputFormat ] [
attrprofattr:attrProfAttrName]
NameGenValue : NAMEGEN last:lastAttrName attrName, outputFormat, attrProfAttrName and lastInstName are string values.
The value of the atttribute specified by attrName is used for the name generation.
1. If this attribute is an INTERREF attribute, the format can be specified by outputFormat.outputFormat can be any string. The following characters are replaced by attribute value information:
- %m model name
- %t model type
- %o instance name
- %c class name
The default value for instance (object) references is "%o (%c) - %m (%t)", the default value for model references is "%m (%t)"
2. If the attribute specified by attrName is of type ATTRPROFILEREFERENCE, the value of an attribute of the referenced attribute-profile-instance can be defined for name generation. In this case the attribute-profile-attribute can be specified by attrProfAttrName. If the ATTRPROFILEREFERENCE does not reference an instance of the attribute-profile-class, the default values defined for the attribute-profile-class are used for name generation (if there are defined default values in for the class).