Use Case 8: Generate a Downstream Structure by Skipping a Part Based on Two Attributes
Consider that the following structure is present in the BOM Transformer:
• An equivalent link exists between the Upstream Parent Part (Design) and Downstream Parent Part (Manufacturing).
• Part C2 (Design), Part C3 (Design), Part C5 (Design), and Part C6 (Design) have the part usage attribute Attribute1 set to true.
| Attribute1 is an attribute of type Boolean. In Windchill, the values for this attribute are Yes and No. true and false are synonymous to Yes and No, respectively. |
• All the parts in the structure have the part type as wt.part.WTPart.
To generate the downstream structure by skipping a part based on two attributes, you can specify the transformation and restructuring rules using rules file or properties file.
Using Rules File
{
"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"
]
}
]
}
Using Properties File
1. Access the associativity.properties.xconf file located in Windchill/codebase/com/ptc/core/foundation/associativity.
2. Add the following restructuring rules:
<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"/>
After you initiate the
action on the selected part in the upstream, the Windchill system traverses the structure below the selected part. This configuration ensures that:
• If the Windchill system detects a part in the upstream with the part attribute Attribute1 set to true, then it is transformed in the downstream under the part whose attribute CustomAttribute1 is set to String1. It is transformed as a new part
• If the Windchill system detects a part in the upstream with the part usage attribute Attribute2 set as true and attribute Source set as buy, then the part is skipped and is not added in the downstream. However, the structure below the detected part is traversed.
The following structure appears in the BOM Transformer:
• Part C1 (Design) is skipped. It is not added in the downstream as it satisfies the specified criteria:
◦ <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) is not added in downstream as Attribute1 is set to false.
• No part is added under Part T2 (Manufacturing) as its part usage attribute CustomAttribute1 value is set to String2 and not to String1.
Related information