使用关系链接表达式和具体值表达式
要加载具体值表达式,需确保系统中存在可配置部件和子项部件。如果必须同时加载可配置部件和子项部件,则请按照以下顺序进行操作:
加载具有使用关系链接和具体值的可配置部件
加载使用关系链接表达式 (如果存在)
加载分配给具体值的表达式
* 
如果使用关系链接表达式和具体值表达式均需加载,则必须先加载使用关系链接表达式,然后再加载具体值表达式。
要加载具体值,请在用于加载可配置结构的加载文件中包括一个语句,如下所示。
<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>
如果您要将表达式分配给使用关系链接,则必须在 <csvBeginOccurrencedAssemblyAdd> 块后立即执行此操作,而无需指定“位号”。下一示例将显示如何将基本表达式分配给使用关系链接。
<csvChoiceMappableChoiceLink handler="com.ptc.windchill.option.load.Loader.createChoiceMappableChoiceLin">
<csvchoiceName>8GB </csvchoiceName>
<csvInstanceValue/>
<csvExclude/>
</csvChoiceMappableChoiceLink
下一示例将显示如何加载分配给具体值的基本表达式:
<!-- 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"/>
下一示例将显示如何将高级表达式加载至具体值:
<!-- 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"/>
* 
如果您只需要加载使用关系链接并为其分配表达式,则建议您使用 <csvAssemblyAdd>。
以下示例显示了在已定义可配置部件和子项部件的情况下,如何加载使用关系链接并为其分配基本表达式:
<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"/>
这对您有帮助吗?