Customization > Automation Interface > Functions > For Models > InstantiateDecisionSet function (automation interface)
InstantiateDecisionSet function (automation interface)
Syntax:
InstantiateDecisionSet (\\SQL\<server>@<instance>\<database>\<model>\<version>", , <decision set id>, <delete existing variants>, <error count>, <warnings count>, <log>)
Where:
<server> is a string that specifies the name of the server on which the Database resides. The case of the name must be correct.
<database> is a string that specifies the name of the Database that owns the Model from which you want to create a product model. The case of the name must be correct.
<model> is a string that specifies the name of the Model from which you want to create a product model. The case of the name must be correct.
<version> is a string that specifies the version of the Model from which you want to create a product model. If the Model has not been versioned, the version is 0.
<decision set id> is a string that specifies the id of the Decision Set that is going to be used to create the Product Model.
<delete existing variants> specifies whether existing Variants are deleted. Possible values are True or False. We recommend that you set this to True.
<error count> returns the number of errors encountered during the creation of the Product Model.
<warnings count> returns the number of warnings encountered during the creation of the Product Model.
<log> returns the name of the log file that is generated during the creation of the Product Model.
This InstantiateDecisionSet function creates a product model from a model using a specified Decision Set and returns the reference of the product model that is created.
Note that A Product Model can be created using a Decision Set only when there are no inconsistencies in that Decision Set and at least one decision has been made. For more information, see the following topics:
Examples
The following example creates a Product Model from MyModel using the referenced Decision Set.
Set objManager = CreateObject("Studio.ModelManager")
objManager.InstantiateDecisionSet("\\SQL\MyServer@MODELER\MyDatabase",9fb6cdf0-25e8-426e-bf43-cb4c0eae3251,True, 0, 0, "")