BDD 2007 Tips - Creating Model Aliases
When trying to manage drivers and hardware specific application with BDD 2007, I have found that with some model types (HP D530) return many variations on the same model number. While these have slight variations to their model names they have virtually no difference to their driver set. This means that I end up wasting heaps of time duplicating database entries for each of these model types.
There is however a solution to this issue., here it is….
I use it to cater for all the HP machine types which have slight variations to their model names but virtually no difference to their driver set. These names are composed of a model name and then a code, for example “Hp D530 (XY12345)”. This solution simply truncates the names at the “(“.
To implement this solution perform the following steps:
- Create aliases for Hardware types in the “Make and Model” section of the Database. In this example I truncate the Model type at the “(“ in the model name. (eg. "HP D530" rather than “Hp D530 (XY12345)")
- Update the rules in the following manner
- Add the custom variable “ModelAlias” to the “[settings section]”
- Create a new “SetModel” section.
- Add the “SetModel” section to the Priority settings in the “Settings” section
- Add a line to the “ModelAlias” section to refer to a user exit script that will truncate the model name at the “(“
- Create a “MMApplications” DB lookup where the “Model” column is matched with the “ModelAlias”
- Create a “User Exit” script and place it in the same directory as the CustomSettings.ini file to truncate the Model name.
Here are samples of the userexit script and CustomSettings.ini.
Customsettings.ini:
[Settings]
Priority=SetModel, MMApplications, Default
Properties= ModelAlias
[SetModel]
ModelAlias=#SetModelAlias()#
Userexit=Userexit.vbs
[MMApplications]
SQLServer=AHSL99
Database=BDD2007AdminDB
Netlib=DBNMPNTW
SQLShare=logs
Table=MakeModelApplications
Parameters=Make, ModelAlias
ModelAlias=Model
Order=Sequence
User Exit script:
Function UserExit(sType, sWhen, sDetail, bSkip)
UserExit = Success
End Function
Function SetModelAlias()
if Instr(oEnvironment.Item("Model"), "(") <> 0 then
SetModelAlias = Left(oEnvironment.Item("Model"),Instr(oEnvironment.Item("Model"), "(") - 1)
oLogging.CreateEntry "USEREXIT - ModelAlias has been set to " & SetModelAlias, LogTypeInfo
else
SetModelAlias = oEnvironment.Item("Model")
oLogging.CreateEntry " USEREXIT - ModelAlias has not been changed." , LogTypeInfo
End if
End Function
I you would like further information regarding the functionality of database lookups and user exit scripts please refer to the following blog:
https://blogs.technet.com/benhunter/archive/2007/03/17/understanding-bdd-rule-processing.aspx
Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .