It is possible to establish a dynamic correlation between usage record properties in which one usage record property can instantiate another. For example, if a user is specified in a charge but no project is specified then the user's default project should be applied to the account constraints and logged; or if a project is specified in a charge but not its organization then the organization corresponding to that project should be looked up and applied to the account constraints and logged. Three usage record property instantiator types are currently supported and are configured by prefixing the property instance's Values foreign object reference with the appropriate characters: Assign if not defined (@?=), Assign if not different (@!=), Assign always (@:=). We shall look at each of these individually and in different terms.
First we add a DefaultProject attribute (the name is arbitrary) to the User object and give it a Values property of @?=Project.
$ goldsh Attribute Create Object=User Name=DefaultProject DataType=String Values="\"@?=Project\"" Description="\"Default Project\"" Successfully created 1 attribute
Then we can establish the default project for user scottmo to be chemistry.
User Modify Name==scottmo DefaultProject=chemistry Successfully modifed 1 user
Subsequently, when a Charge, Reserve or Quote is issued that specifies the User scottmo but does not specify the Project, the Project chemistry Project will be applied to the charge as if originally specified in the usage record charge data.
First we add a VerifyOrganization attribute (the name is arbitrary) to the Project object and give it a Values property of @!=Organization.
$ goldsh Attribute Create Object=Project Name=VerifyOrganization DataType=String Values="\"@!=Organization\"" Description="\"Verify Organization\"" Successfully created 1 attribute
Then we can establish the verify organization for project chemistry to be sciences.
$ goldsh Project Modify Name==chemistry VerifyOrganization=sciences Successfully modifed 1 project
Subsequently, when a Charge, Reserve or Quote is issued that specifies the Project chemistry and specifies the wrong Organization (e.g. arts), the transaction will fail with an error message. Additionally, when a Charge, Reserve or Quote is issued that specifies the Project chemistry but does not specify the Organization, the Organization sciences will be applied to the charge as if originally specified in the usage record charge data.
First we add an OverrideOrganization attribute (the name is arbitrary) to the Project object and give it a Values property of @:=Organization.
$ goldsh Attribute Create Object=Project Name=OverrideOrganization DataType=String Values="\"@:=Organization\"" Description="\"Override Organization\"" Successfully created 1 attribute
Then we can establish the override organization for project chemistry to be sciences.
$ goldsh Project Modify Name==chemistry OverrideOrganization=sciences Successfully modifed 1 project
Subsequently, when a Charge, Reserve or Quote is issued that specifies the Project chemistry and specifies either the wrong Organization (e.g. arts) or no Organization, the Organization sciences will be silently applied to the charge as if originally specified in the usage record charge data.
(Undefined variable: MyVariables.!CopyrightInfo!)