ユースケース 8: 2 つの属性に基づいて部品をスキップして下流構造を生成
BOM トランスフォーマに以下の構造が存在するとします。
Upstream Parent Part (Design)Downstream Parent Part (Manufacturing) の間に対応リンクが存在します。
Part C2 (Design)Part C3 (Design)Part C5 (Design)、および Part C6 (Design) の部品親子関係属性 Attribute1true に設定されています。
* 
Attribute1 はブール型の属性です。Windchill では、この属性の値は YesNo です。true および false はそれぞれ Yes および No と同義です。
構造内のすべての部品の部品タイプは wt.part.WTPart です。
2 つの属性に基づいて部品をスキップして下流構造を生成するには、規則ファイルまたはプロパティファイルを使用して変換規則と再構築規則を指定できます。
規則ファイルを使用
{
"transformRules": [
{
"sourceType": "wt.part.WTPart",
"newAttributeMappings": [
[
"source.usage.Attribute1:true",
"target.part.CustomAttribute1:String1",
"doAndValidationForAttr": "true"
]
],
"targetType": "wt.part.WTPart",
"transformOption": "newPart",
"skipAttributes":
[
"source:buy",
"Attribute2":"true"
]
}
]
}
プロパティファイルを使用
1. Windchill/codebase/com/ptc/core/foundation/associativity にあるファイル associativity.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"/>
上流で選択した部品に対して 操作を開始すると、選択した部品の下の構造がスキャンされます。このコンフィギュレーションによって以下の処理が行われます。
部品属性 Attribute1true に設定されている部品が上流で検出された場合、その部品は、下流の、属性 CustomAttribute1String1 に設定されている部品の下に変換されます。これは新規部品として変換されます
部品親子関係属性 Attribute2true に設定され、属性 Sourcebuy に設定されている部品が上流で検出された場合、その部品はスキップされ、下流には追加されません。ただし、検出された部品の下の構造はスキャンされます。
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"/>
Attribute1false に設定されているので、Part C4 (Design) は下流に追加されません。
Part T2 (Manufacturing) の部品親子関係属性 CustomAttribute1 の値は String1 ではなく String2 に設定されているので、この部品の下に部品は追加されません。
これは役に立ちましたか?