So, someone asked me(you know who you are) if it is possible to convert something like a computer model into a role, and yes that is possible and some times a pretty smart thing to do. It becomes really great if you are using the ModelAlias Userexit script and you would like to use the database to define settings. The database has support for make and model, but since you are using modelalias instead of make and model, well then you can define settings as a role instead. The only thing you need to do is to convert the ModelAlias value into a Role and you are done. In this post I will describe two scenarios, one when you convert model into a role and the other is when you turn the modelalias into a role.
Converting Model into a Role:
In the customsettings.ini file we have three sections in the priority line: ConvertModelToRole,Role,Default and one customproperty just for fun
- ConvertModelToRole – will set the Role001 into RoMo-“the return of the model”
- Role – will search for a section with the name of RoMo-“the return of the model”
- Default – set default values
Sample CustomSettings.ini file
The output when running ZTIGather.wsf to test the inifile.
Converting ModelAlias into a role:
In the customsettings.ini file we have four sections in the priority line: HardwareInfo,ConvertModelToRole,Role,Default
- HardwareInfo – will execute the modelalias userexit script and return a value from that script
- ConvertModelToRole – will set the Role001 into RoMo-“the return of the model alias user exit script result”
- Role – will search for a section with the name of RoMo-“the return of the model alias user exit script result”
- Default – set default values
Sample CustomSettings.ini file
The output when running ZTIGather.wsf to test the inifile.
You can download the sample ini files here: http://1drv.ms/1LiIw7H
The UserAlias Userexit script is here: http://1drv.ms/1LiIVHh
Instructions on how to test customsettings.ini is here:https://anothermike2.wordpress.com/2011/04/27/quick-and-dirty-testing-customsettings-ini-variables-in-mdt/
/mike