Resolving Discrepancies in the BOM Transformer
To resolve the discrepancies between upstream and downstream structures in the BOM transformer, you must first detect discrepancies using the DetectDiscrepancies action:
POST Windchill/servlet/odata/BomTransformation/DetectDiscrepancies
You can resolve the detected discrepancies using the set of attributes that the DetectDiscrepancies action returns in its response. The set of attributes returned for each detected discrepancy in the DetectDiscrepancies response is specified as an input in the ResolveDiscrepancies request payload. For example, the following is the set of attributes specified as input to the ResolveDiscrepancies request:
{
"Identity": "0000000305, ChildChild1, A.1 (Design)",
"Number": "0000000305",
"Name": "ChildChild1",
"Version": "A.1 (Design)",
"Criteria": "Removed Parts",
"CurrentValue": "",
"PreviousValue": "0000000302|0000000305",
"DownstreamParentPath": [
""
],
"Status": "Auto",
"InternalMetadata": "eyJTdGF0dXMiOiJBdXRvIiwiQ3VycmVudFZhbHVlSW50ZXJuYWxOYW1lIjoiIiwiRGlzY3JlcGFuY3lTdGF0dXNNZXNzYWdlIjoiIiwiZG93bnN0cmVhbVBhcmVudCI6IjAwMDAwMDAzMDJ8MDAwMDAwMDMwNSIsIlJlbW92ZWRDaGlsZCI6Ind0LnBhcnQuV1RQYXJ0OjI2NTkyMiIsInVwc3RyZWFtSW1wYWN0ZWRPYmplY3QiOiIiLCJEaXNjcmVwYW50UGF0aFJvb3QiOiJ3dC5wYXJ0LldUUGFydE1hc3RlcjoyNjU4NjciLCJDdXJyZW50VmFsdWUiOiIiLCJTdGF0dXNJbnRlcm5hbE5hbWUiOiJBVVRPIiwiUHJldmlvdXNWYWx1ZUludGVybmFsTmFtZSI6IjAwMDAwMDAzMDJ8MDAwMDAwMDMwNSIsIlByZXZpb3VzVmFsdWUiOiIwMDAwMDAwMzAyfDAwMDAwMDAzMDUiLCJUYXJnZXRQYXRocyI6W3siUGF0aCI6Ii85MTI4MjBhMy0yZjIwLTRhYWEtYjAxOS05M2I4NDNkNDQ0MzkiLCJSb290Ijoid3QucGFydC5XVFBhcnRNYXN0ZXI6MjY1ODY3IiwiTGVhZiI6Ind0LnBhcnQuV1RQYXJ0TWFzdGVyOjI2NTkxOSJ9XSwibnVtYmVyIjoiMDAwMDAwMDMwNSIsIlR5cGUiOiJSZW1vdmVkIFBhcnRzIiwiVHlwZUludGVybmFsTmFtZSI6IlJFTU9WRURfVVNBR0UiLCJEaXNjcmVwYW50UGF0aCI6Ii8iLCJWZXJzaW9uIjoiQS4xIChEZXNpZ24pIiwiaWRlbnRpdHkiOiIwMDAwMDAwMzA1LCBDaGlsZENoaWxkMSwgQS4xIChEZXNpZ24pIiwibmFtZSI6IkNoaWxkQ2hpbGQxIiwiUmVtb3ZlZFVzYWdlIjoid3QucGFydC5XVFBhcnRVc2FnZUxpbms6MjY1OTMxIiwiSWQiOiJmZWY0ZjI1MC00YzQ2LTQxYWItYjY5Mi02OTBkMDIyNWZkNDkiLCJpc0Rpc2NyZXBhbnRQYXRoSW5PY2N1cnJlbmNlTW9kZSI6ZmFsc2UsIkRvd25zdHJlYW1Db250ZXh0IjoiTWFudWZhY3R1cmluZyIsIkRpc2NyZXBhbnRQYXRoTGVhZiI6Ind0LnBhcnQuV1RQYXJ0TWFzdGVyOjI2NTg2NyJ9"
}
 
The request resolves only the discrepancies of the Auto status from the detected discrepancies.
If the CheckInDownstreamObject flag is not provided in the request payload, the affected object in the downstream structure remains checked out after propagation.
You can use the following API to fetch additional information of a part in the BOM transformer required for this request:
POST /Windchill/servlet/odata/BomTransformation/XBOMParts('<RootPartOID>')/PTC.BomTransformation.GetManufacturingBOM?$expand=Components($levels=max)
This example shows you how to resolve a detected discrepancy with status as Auto and criteria as Removed Parts. Use the following POST URI with the request body:
URI
POST Windchill/servlet/odata/BomTransformation/ResolveDiscrepancies
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"CheckInDownstreamObject": false,
"DiscrepancyItems": [
{
"Identity": "0000000305, ChildChild1, A.1 (Design)",
"Number": "0000000305",
"Name": "ChildChild1",
"Version": "A.1 (Design)",
"Criteria": "Removed Parts",
"CurrentValue": "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BhcnRVc2FnZUxpbms6MjY1OTMxIiwiSWQiOiJmZWY0ZjI1MC00YzQ2LTQxYWItYjY5Mi02OTBkMDIyNWZkNDkiLCJpc0Rpc2NyZXBhbnRQYXRoSW5PY2N1cnJlbmNlTW9kZSI6ZmFsc2UsIkRvd25zdHJlYW1Db250ZXh0IjoiTWFudWZhY3R1cmluZyIsIkRpc2NyZXBhbnRQYXRoTGVhZiI6Ind0LnBhcnQuV1RQYXJ0TWFzdGVyOjI2NTg2NyJ9"
}
],
"DiscrepancyContext": {
"UpstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:265539')",
"TargetRoot@odata.bind": "Parts('OR:wt.part.WTPart:267364')",
"SourceRoot@odata.bind": "Parts('OR:wt.part.WTPart:267254')",
"SourcePartSelection": [],
"DownstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:265574')"
}
}
The request resolves the discrepancy and returns the attributes and information of the removed part along with the value of the Status attribute as Resolved.
Example: Resolving Discrepancies by Selecting a Different Downstream Parent Part to Propagate
This example shows you how to resolve a detected discrepancy that has status as Auto and criteria as Added Parts by selecting a different downstream parent part. Use the following POST URI with the request body:
URI
POST Windchill/servlet/odata/BomTransformation/ResolveDiscrepancies
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"CheckInDownstreamObject": true,
"DiscrepancyItems": [
{
"Identity": "0000000307, ChildsNewName, A.1 (Design)",
"Number": "0000000307",
"Name": "ChildsNewName",
"Version": "A.1 (Design)",
"Criteria": "Added Parts",
"CurrentValue": "0000000302|0000000307",
"PreviousValue": "",
"DownstreamParentPath": [
"ffd33891-c1b3-4cf9-bf79-917cd06639af|b68841c8-230e-4afc-b103-396912028f9d"
],
"Status": "Auto",
"InternalMetadata": "eyJTdGF0dXMiOiJBdXRvIiwiQ3VycmVudFZhbHVlSW50ZXJuYWxOYW1lIjoiMDAwMDAwMDMwMnwwMDAwMDAwMzA3Iiw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yContext": {
"UpstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:265539')",
"TargetRoot@odata.bind": "Parts('OR:wt.part.WTPart:267364')",
"SourceRoot@odata.bind": "Parts('OR:wt.part.WTPart:267254')",
"SourcePartSelection": [],
"DownstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:265574')"
}
}
The request resolves the discrepancy and returns the attributes and information of the added part along with the value of the Status attribute as Resolved. The downstream parent part under which the new part is added remains checked in after the discrepancy is resolved.