Data Management Capabilities > Managing Part Structures > Windchill Options and Variants Capabilities > Managing Data for Options and Variants — Reference > Loading Data for Options and Variants > Option and Choices
  
Option and Choices
Load the com.ptc.windchill.option.model.Option object with the option subtypes and the associated choices in the Windchill database using the Windchill loader.
This method allows you to load all choices that are associated with a given option as part of the option loading process. As the option is loaded, the system creates the first iteration of the option (for example, as A.1) and checks it out. Once all associated choices are loaded, the option is checked in (for example, as A.2).
* 
For proper loading of options and choices, make sure all open tags have the corresponding closing tags.
XML Format for Loading an Option with its Associated Choices:
<csvBeginOption handler="com.ptc.windchill.option.load.Loader.beginOption" >
<csvtypedef>option type to be created</csvtypedef>
<csvname>option name</csvname>
<csvdescription>description</csvdescription>
<csvoptionDataType>option data type STRING/NUMERIC</csvoptionDataType> <!--Optional if using STRING-->
<csvQoMName>QoM name</csvQoMName> <!-- Only needed with NUMERIC options (required) -->
<csvoptionGroup>option group</csvoptionGroup>
<csvsingleChoiceSelection>select single choice true/false</csvsingleChoiceSelection>
<csvrequiredOptionn>require selection for option true/false</csvrequiredOption>
</csvBeginOption >
<csvBeginChoice handler="com.ptc.windchill.option.load.Loader.beginChoice">
. . .

</csvBeginChoice>
<csvEndChoice handler="com.ptc.windchill.option.load.Loader.endChoice"/>

... n choices
<csvEndOption handler= "com.ptc.windchill.option.load.Loader.endOption" />
Attributes for csvBeginOption
Attribute
Description
Required or Optional?
csvtypedef
Windchill object type
Required
csvname
Option name
Required
csvnumber
Option number
Optional
csvdescription
Description for the option
Optional
csvoptionGroup
Name of the group to which the option belongs
Optional
csvrequiredOption
Specifies whether the option is Required
Optional
csvsingleChoiceSelection
Specifies whether the option is a single-selection option
Optional
csvoptionDataType
Specifies whether the option has choices with numeric values
Optional
csvQoMName
Specifies the Quantity of Measure for an option with numeric values
Optional
csvOverrideDisplayUnits
Use this field to set override units for the specified measurement system in the format SI:mm;MKS:cm.
Optional
Attributes for csvBeginChoice
Attribute
Description
Required or Optional?
csvname
Choice name
Required
csvnumber
Choice number
Optional
csvdescription
Choice description
Optional
csvoption
Option name for which the choice was defined
Required
csvtypedef
Windchill object type
Required
csvchoiceDataValue
Specifies the value for a numeric choice
Optional
Example:
<csvBeginOption handler="com.ptc.windchill.option.load.Loader.beginOption">
<csvtypedef>com.ptc.windchill.option.SalesOption</csvtypedef>
<csvname>Colours</csvname>
<csvoptionGroup>Colour configuration</csvoptionGroup>
<csvsingleChoiceSelection>false</csvsingleChoiceSelection>
</csvBeginOption>
<csvBeginChoice handler="com.ptc.windchill.option.load.Loader.beginChoice">
<csvname>Red</csvname>
<csvdescription>Red</csvdescription>
<csvoption>Colors</csvoption>
<csvtypedef>com.ptc.windchill.option.SalesChoice</csvtypedef>
</csvBeginChoice>
<csvEndChoice handler="com.ptc.windchill.option.load.Loader.endChoice"/>

<csvBeginChoice handler="com.ptc.windchill.option.load.Loader.beginChoice">
<csvname>Green</csvname>
<csvdescription>Green</csvdescription>
<csvoption>Colors</csvoption>
<csvtypedef>com.ptc.windchill.option.SalesChoice</csvtypedef>
</csvBeginChoice>
<csvEndChoice handler="com.ptc.windchill.option.load.Loader.endChoice"/>

<csvBeginChoice handler"com.ptc.windchill.option.load.Loader.beginChoice"=>
<csvname>Blue</csvname>
<csvdescription>Blue</csvdescription>\
<csvoption>Colors</csvoption>
<csvtypedef>com.ptc.windchill.option.SalesChoice</csvtypedef>
</csvBeginChoice>
<csvEndChoice handler="com.ptc.windchill.option.load.Loader.endChoice"/>

<csvBeginChoice handler="com.ptc.windchill.option.load.Loader.beginChoice">
<csvname>Glossy</csvname>
<csvdescription>Glossy</csvdescription>
<csvoption>Finishing</csvoption>
<csvtypedef>com.ptc.windchill.option.SalesChoice</csvtypedef>
</csvBeginChoice>
<csvEndChoice handler=/"com.ptc.windchill.option.load.Loader.endChoice">

<csvBeginChoice handler=>"com.ptc.windchill.option.load.Loader.beginChoice"
<csvname>Matt</csvname>\
<csvdescription>Matt</csvdescription>
<csvoption>Finishing</csvoption>
<csvtypedef>com.ptc.windchill.option.SalesChoice</csvtypedef>
</csvBeginChoice>
<csvEndChoice handler="com.ptc.windchill.option.load.Loader.endChoice"/>
<csvBeginOption handler="com.ptc.windchill.option.load.Loader.beginOption">
<csvtypedef>com.ptc.windchill.option.SalesOption</csvtypedef>
<csvname>Finishing</csvname>
<csvoptionGroup>Colour configuration</csvoptionGroup>
<csvsingleChoiceSelection>false</csvsingleChoiceSelection>
< csvrequiredChoiceSelection>true</ csvrequiredChoiceSelection>
<csvEndOption handler="com.ptc.windchill.option.load.Loader.endOption"/>
Example of a Loading a Numeric Option
<csvBeginOption handler="com.ptc.windchill.option.load.Loader.beginOption">
<csvtypedef>com.ptc.windchill.option.DesignOption</csvtypedef>
<csvname>OCTD_LENGTH</csvname>
<csvoptionDataType>NUMERIC</csvoptionDataType>
<csvQoMName>Length</csvQoMName>
<csvOverrideDisplayUnits>SI:cm;MKS:mm</csvOverrideDisplayUnits>
<csvoptionGroup></csvoptionGroup>
<csvsingleChoiceSelection>True</csvsingleChoiceSelection>
</csvBeginOption>
Example of Loading A Numeric Choice
* 
The choice inherits its choice data type from its option.
<csvBeginChoice handler="com.ptc.windchill.option.load.Loader.beginChoice">
<csvname>OCTD_10M</csvname>
<csvdescription>OCTD_10M</csvdescription>
<csvchoiceDataValue>10</csvchoiceDataValue>
<csvoption>OCTD_LENGTH</csvoption>
<csvtypedef>com.ptc.windchill.option.DesignChoice</csvtypedef>
</csvBeginChoice>
<csvEndChoice handler="com.ptc.windchill.option.load.Loader.endChoice"/>