Customization > Extensibility Through Profiles, Stereotypes, Tag Definitions and Scripts > Script functions, objects and attributes > Script functions, objects and attributes > Script functions, attributes and objects - derivation scripts for variability parameters
  
Script functions, attributes and objects - derivation scripts for variability parameters
In addition to the standard Modeler automation interface functions, objects and attributes, there are special functions, objects and attributes you can use in the derivation scripts for variability parameters. For general information about scripts, including information about the Modeler, Projects, ActiveProject and Dictionary objects that are available in most script functions, see Script functions, attributes and objects - overview.
To write scripts you require a good working knowledge of the VBScript language, the Modeler Meta Model and the Modeler Automation Interface.
* 
If you run a script that has errors, those errors can cause Modeler to crash and corrupt Modeler model data.
Variants and Requires Dependencies can own variability parameters.
Note that when a variability item is referenced as a model object reference in the derivation script for variability parameter, it is the runtime Decision Set object that is referenced NOT the Modeler object. If you want to use the Modeler object, you must retrieve it through its id, for example, at runtime.
These functions are case sensitive and cannot be used in any other scripts.
EvaluateParameter function - All script must be within the EvaluateParameter function.
This function can use the following attributes:
Excluded attribute - returns whether the Status of a Variant or Variation Point is set to Excluded in the context of the Decision Set that is being edited in the Decision Set Editor or Variant Selector. Example code:
Function EvaluateParameter
If = Variant2.Excluded Then
EvaluateParameter = True
Else
EvaluateParameter = False
End If
End Function
Included attribute - returns whether the Status of a Variant or Variation Point is set to Included in the context of the Decision Set that is being edited in the Decision Set Editor or Variant Selector. Example code:
Function EvaluateParameter
If = Variant2.Included Then
EvaluateParameter = True
Else
EvaluateParameter = False
End If
End Function
Inconsistent attribute - returns whether the Status of a Variant or Variation Point is set to Inconsistent in the context of the Decision Set that is being edited in the Decision Set Editor or Variant Selector. Example code:
Function EvaluateParameter
If = Variant2.Inconsistent Then
EvaluateParameter = True
Else
EvaluateParameter = False
End If
End Function
ParameterValue attribute - returns the parameter value of a Variant or Requires Dependency in the context of the Decision Set that is being edited in the Decision Set Editor or Variant Selector. Example code
Function EvaluateParameter
EvaluateParameter = Variant1.ParameterValue * 10
End Function
Undecided attribute - returns whether the Status of a Variant or Variation Point is set to Undecided in the context of the Decision Set that is being edited in the Decision Set Editor or Variant Selector. Example code:
Function EvaluateParameter
If = Variant2.Undecided Then
EvaluateParameter = True
Else
EvaluateParameter = False
End If
End Function