用例 8:通过基于两个属性跳过部件来生成下游结构
假设 BOM 变换器中存在以下结构:
Upstream Parent Part (Design)Downstream Parent Part (Manufacturing) 之间存在对等链接。
Part C2 (Design)Part C3 (Design)Part C5 (Design)Part C6 (Design) 的部件使用关系属性 Attribute1 均设为 true
* 
Attribute1 是布尔型属性。在 Windchill 中,此属性的值为 YesNotruefalse 分别等同于 YesNo
结构中所有部件的部件类型均为 wt.part.WTPart
1. 访问位于 Windchill/codebase/com/ptc/core/foundation/associativityassociativity.properties.xconf 文件。
2. 添加以下重构规则:
<Property name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" multivalued="," default=""/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="transformoption=newPart"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="targetType=wt.part.WTPart"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="attributeMapping.rule1=Attribute1:true:CustomAttribute1:String1"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="skipAttribute.source=Buy"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="skipAttribute.Attribute2=true"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="doAndValidationForAttr=true"/>
* 
对上游选定部件启动 操作后,Windchill 系统将遍历选定部件下方的结构。 此配置可确保:
如果 Windchill 系统在上游结构中检测到部件使用关系属性 Attribute1 设为 true 的部件,则会将检测到的部件变换到下游结构中部件使用关系属性 CustomAttribute1 设为 String1 的部件之下。该部件被转换为新部件。
如果 Windchill 系统在上游结构中检测到部件使用关系属性 Attribute2 设为 true 且属性 Source 设为 Buy 的部件,则会跳过该部件,而不会将其添加到下游结构中。但是,将遍历检测到的部件下方的结构。
3. 选择 Upstream Parent Part (Design),然后单击中间窗格工具栏中的
4. BOM 变换器中会显示下列结构:
* 
Part C1 (Design) 会被跳过。该部件会被添加到下游结构中,因为该部件满足以下特性中设置的条件:
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="skipAttribute.source=Buy"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="skipAttribute.Attribute2=true"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="doAndValidationForAttr=true"/>
Part C4 (Design) 不会被添加到下游结构中,因为 Attribute1 被设置为 false
不会在 Part T2 (Manufacturing) 之下添加任何部件,因为其部件使用关系属性 CustomAttribute1 设为 String2,而非 String1
这对您有帮助吗?