Expressions on Usage Links and Occurrences
To load expressions on occurrences, you need to make sure the configurable part and the child part are present in the system. If the configurable part and child parts must also be loaded, follow the following order:
Load the configurable part with usage links and occurrences
Load expressions on usage links, if any
Load the expression assigned to the occurrence
* 
If you need to load expressions both on usage links and occurrences, loading expressions on occurrences must follow after the loading expressions on usage links.
To load an occurrence, include a statement in the load file for loading configurable structures, as shown next.
<csvBeginOccurrencedAssemblyAdd handler="wt.part.LoadPart.beginOccurrencedAssemblyAdd">
<csvassemblyPartNumber>CONFIGURABLE_PART_NUMBER</csvassemblyPartNumber>
<csvassemblyPartVersion/>
<csvconstituentPartNumber>CHILD_PART_NUMBER</csvconstituentPartNumber>
<csvconstituentPartQty>QUANTITY</csvconstituentPartQty>
<csvconstituentPartUnit>UNIT</csvconstituentPartUnit>
<csvlineNumber/>
<csvfindNumber/>
<csvoccurrenceLocation>LOCATION</csvoccurrenceLocation>
<csvreferenceDesignator>OCCURRENCE</csvreferenceDesignator>
<csvassemblyPartIteration/>
<csvassemblyPartView>VIEW</csvassemblyPartView>
<csvorganizationName/>
<csvorganizationID/>
</csvBeginOccurrencedAssemblyAdd>
If you want to assign an expression to a usage link, you must do it right after the <csvBeginOccurrencedAssemblyAdd> block, without specifying the reference Designator. The next example show how to assign a basic expression to usage link.
<csvChoiceMappableChoiceLink handler="com.ptc.windchill.option.load.Loader.createChoiceMappableChoiceLin">
<csvchoiceName>8GB </csvchoiceName>
<csvInstanceValue/>
<csvExclude/>
</csvChoiceMappableChoiceLink
The next example shows how to load a basic expression assigned to an occurrence:
<!-- Add Basic Expression to OCCURRENCE-2 -->
<csvBeginAssignBasicExpression handler="com.ptc.windchill.option.load.Loader.beginAssignBasicExpression">
<csvoptionSet>Has Optionality</csvoptionSet>
<csvreferenceDesignator>OCCURRENCE-2</csvreferenceDesignator>
</csvBeginAssignBasicExpression>
<csvAddBasicExpressionMember handler="com.ptc.windchill.option.load.Loader.addBasicExpressionMember">
<csvchoiceName>8-MP</csvchoiceName>
<csvInstanceValue/>
<csvExclude/>
</csvAddBasicExpressionMember>
<csvEndAssignBasicExpression handler="com.ptc.windchill.option.load.Loader.endAssignBasicExpression"/>
The next example shows how to load an advanced expression to an occurrence:
<!-- Add Advanced Expression to OCCURRENCE-1 -->
<csvBeginAssignExpression handler="com.ptc.windchill.option.load.Loader.beginAssignExpression">
<csvexpression>EXP1 OR EXP2</csvexpression>
<csvreferenceDesignator>OCCURRENCE-1</csvreferenceDesignator>
</csvBeginAssignExpression>
<csvAddLogicalExpression handler="com.ptc.windchill.option.load.Loader.addLogicalExpression">
<csvnumber>EXP1</csvnumber>
<csvexpression>"8-MP" AND "8GB"</csvexpression>
<csvdescription></csvdescription>
</csvAddLogicalExpression>
<csvAddLogicalExpressionMember handler="com.ptc.windchill.option.load.Loader.addLogicalExpressionMember">
<csvmemberName>8-MP</csvmemberName>
<csvmemberNumber/>
<csvmemberClass>com.ptc.windchill.option.model.ChoiceMaster</csvmemberClass>
<csvcontainerPath>/wt.inf.container.OrgContainer=Demo Organization/wt.pdmlink.PDMLinkProduct=AssignOptionalityTestData</csvcontainerPath>
</csvAddLogicalExpressionMember>
<csvAddLogicalExpressionMember handler="com.ptc.windchill.option.load.Loader.addLogicalExpressionMember">
<csvmemberName>8GB</csvmemberName>
<csvmemberNumber/>
<csvmemberClass>com.ptc.windchill.option.model.ChoiceMaster</csvmemberClass>
<csvcontainerPath>/wt.inf.container.OrgContainer=Demo Organization/wt.pdmlink.PDMLinkProduct=AssignOptionalityTestData</csvcontainerPath>
</csvAddLogicalExpressionMember>
<csvEndLogicalExpression handler="com.ptc.windchill.option.load.Loader.endLogicalExpression"/>
<csvAddLogicalExpression handler="com.ptc.windchill.option.load.Loader.addLogicalExpression">
<csvnumber>EXP2</csvnumber>
<csvexpression>"6-MP" AND "16GB"</csvexpression>
<csvdescription></csvdescription>
</csvAddLogicalExpression>
<csvAddLogicalExpressionMember handler="com.ptc.windchill.option.load.Loader.addLogicalExpressionMember">
<csvmemberName>6-MP</csvmemberName>
<csvmemberNumber/>
<csvmemberClass>com.ptc.windchill.option.model.ChoiceMaster</csvmemberClass>
<csvcontainerPath>/wt.inf.container.OrgContainer=Demo Organization/wt.pdmlink.PDMLinkProduct=AssignOptionalityTestData</csvcontainerPath>
</csvAddLogicalExpressionMember>
<csvAddLogicalExpressionMember handler="com.ptc.windchill.option.load.Loader.addLogicalExpressionMember">
<csvmemberName>16GB</csvmemberName>
<csvmemberNumber/>
<csvmemberClass>com.ptc.windchill.option.model.ChoiceMaster</csvmemberClass>
<csvcontainerPath>/wt.inf.container.OrgContainer=Demo Organization/wt.pdmlink.PDMLinkProduct=AssignOptionalityTestData</csvcontainerPath>
</csvAddLogicalExpressionMember>
<csvEndLogicalExpression handler="com.ptc.windchill.option.load.Loader.endLogicalExpression"/>
<csvEndAssignExpression handler="com.ptc.windchill.option.load.Loader.endAssignExpression"/>
* 
If you only need to load a usage link and assign an expression to it, it is recommended that you use <csvAssemblyAdd>.
Here is an example of loading a usage link and assigning a basic expression to it if you already have the configurable part and child part defined:
<csvAssemblyAdd handler="wt.part.LoadPart.addPartToAssembly">
<csvassemblyPartNumber>P00001</csvassemblyPartNumber>
<csvconstituentPartNumber>P00002</csvconstituentPartNumber>
<csvconstituentPartQty>1</csvconstituentPartQty>
<csvconstituentPartUnit>ea</csvconstituentPartUnit>
<csvassemblyPartVersion/>
<csvassemblyPartIteration/>
<csvassemblyPartView>Design</csvassemblyPartView>
</csvAssemblyAdd>
<!-- Add Basic Expression to Usage Link -->
<csvBeginAssignBasicExpression handler="com.ptc.windchill.option.load.Loader.beginAssignBasicExpression">
<csvoptionSet>Has Optionality</csvoptionSet>
</csvBeginAssignBasicExpression>
<csvAddBasicExpressionMember handler="com.ptc.windchill.option.load.Loader.addBasicExpressionMember">
<csvchoiceName>8GB</csvchoiceName>
<csvInstanceValue/>
<csvExclude/>
</csvAddBasicExpressionMember>
<csvEndAssignBasicExpression handler="com.ptc.windchill.option.load.Loader.endAssignBasicExpression"/>
Was this helpful?