18.1.5 Object Auto-Generation

It is possible to have object instances be automatically generated the first time they are referenced in designated contexts. For example, you might want a user be auto-generated when newly added to a project. You could have an organization auto-generated when specified as the default for a user. You could have a cost-center be auto-generated when referenced in a usage record. To do this, the referenced object must be set to AutoGen=True and the Values property for the attribute that you want to trigger the auto-generation must be set to a string consisting of the '@' sign followed by the object name.

Example 7. Auto-generate a machine's organization

For example, let's assume that your machines belong to specific organizations that you may want to run a report against but you don't want to define all of the organizations up front. It would be possible to automatically generate a new organization instance each time an undefined organization is specified for a machine.

$ goldsh Object Modify Name==Organization AutoGen=True
Successfully modified 1 object
$ goldsh Attribute Modify Object==Machine Name==Organization Values=@Organization
Successfully modified 1 attribute

See Usage Record Property Auto-Generation for a discussion of auto-generating objects referenced in usage records.

(Undefined variable: MyVariables.!CopyrightInfo!)