Use Case 13: Generate a Downstream Structure by Skipping a Part Based on the Range Attribute
You can generate a downstream structure by defining a range. There might be a scenario where you may not want to transfer parts whose attribute value falls within a certain range. You can use the skip attribute to skip such parts that have attribute values within a certain range.
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).
• All parts in the structure have the part type as wt.part.WTPart.
• The value of the preference Delimiter to Define the Range is set to >. This is the default value.
• The attribute GDS_Match is created on WTPart. Use this attribute to define the range.
• The part attribute skip_range of type String is created on WTPart. Use this attribute to skip a part.
• The value of the attribute source for Part D1 (Manufacturing) is set to buy.
To generate the downstream structure by skipping a part based on the range attribute, 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.GDS_Match:1>9",
"target.part.source:buy"
]
],
"targetType": "wt.part.WTPart",
"transformOption": "newBranch",
"skipAttributes": [
"skip_range=a20>a90"
]
}
]
}
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=newBranch"/>
<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=GDS_Match:1>9:source:buy"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="skipAttribute.skip_range=a20>a90"/>
| The GDS_Match value 1>9 describes the range. The value of the preference Delimiter to Define the Range is set to >. 1>9 means that the range is from 1 through 9. In this case, the system considers the following values for comparison: 1, 2, 3, 4, 5, 6, 7, 8, and 9. The skip_range value a20>a90 describes the range. The value of the preference Delimiter to Define the Range is set to >. a20>a90 means that the range is from a20 through a90. |
After you perform the Generate Downstream Structure action, the following structure appears in the BOM Transformer:
The system traverses the structure below the selected part. The configuration ensures the following:
• If the value of the attribute GDS_Match attribute for an upstream part is from 1 through 9, then the upstream part is added as a new branch under the target matched downstream part.
• If the Windchill system detects a part in the upstream with the attribute skip_range value set from a20 through a90, then the part is skipped and is not added in the downstream. However, the structure below the detected part is traversed.
Based on the specified criteria, Part C1 (Manufacturing), Part C2 (Manufacturing), Part C6 (Manufacturing), Part C7 (Manufacturing) are added as new parts under Part D1 (Manufacturing).
Subassembly C4 and Subassembly C5 are skipped and are not transferred to the downstream view because the value of the skip_range attribute, is between the specified range, that is a20>a90.