Subcontracting to Plants
You can subcontract a single or multiple parts and their sub-assemblies from the upstream or downstream structure to other plants. You can subcontract by specifying the source root part, source navigation criteria, source parent parts that you want to subcontract, and plant views to which you want to subcontract the specified parent parts.
You can also subcontract the parts and sub-assemblies in the context of change (change task or change notice).
|
• A part is not subcontracted if an upstream or downstream branch already exists for the plant view assigned to the part.
• Subcontracting a parent part also subcontracts its child parts up to the leaf nodes in the structure.
|
Example: Subcontracting Multiple Parts in the Downstream Structure to the Plant Views Assigned to Upstream Parts
This example shows you how to subcontract two downstream parts with the Plant1 view to the two upstream plant views specified as Service1 and Service2, respectively. This example shows you how to subcontract two parts in the downstream structure by specifying the downstream root part, downstream navigation criteria ID, two downstream parent parts, and two upstream plant views to which you want to subcontract the specified parent parts. Use the following POST URI with the request body:
URI
POST Windchill/servlet/odata/BomTransformation/SubcontractToPlants
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ChangeOid": "",
"Views": [
"Service1",
"Service2"
],
"DiscrepancyContext": {
"DownstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:201790')",
"SourceRoot@odata.bind": "Parts('OR:wt.part.WTPart:201389')",
"SourcePartSelection": [
{
"Part@odata.bind": "Parts('OR:wt.part.WTPart:201402')"
},
{
"Part@odata.bind": "Parts('OR:wt.part.WTPart:201444')"
}
]
}
}
The request subcontracts the parent parts along with their child parts. The request also returns information for all the subcontracted parent and child parts along with the information for the associated plants.
Example: Copying Multiple Upstream Parts and Pasting in the Downstream Structure as Paste as Subcontract to Plants
This example shows you how to copy two upstream parts to be subcontracted from the upstream view and paste those to a part in the downstream view.
This example shows you how to copy two upstream parts with the Plant1 view and paste those to the specified target downstream part (here, downstream root part) that has the Plant2 view. Use the following POST URI with the request body:
URI
POST Windchill/servlet/odata/BomTransformation/SubcontractToPlants
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"DiscrepancyContext": {
"SourceRoot@odata.bind": "Parts('OR:wt.part.WTPart:223043')",
"SourcePartSelection": [
{
"Part@odata.bind": "Parts('OR:wt.part.WTPart:223104')",
"Path": "a39bc580-d1ad-4272-af34-ff186045e862|ae297668-eb06-45c4-b7ee-ba2d1b00cd86"
},
{
"Part@odata.bind": "Parts('OR:wt.part.WTPart:223086')",
"Path": "a39bc580-d1ad-4272-af34-ff186045e862|1cfd0626-35b2-4c3b-bb4f-4cfedfe94c3a"
}
],
"TargetRoot@odata.bind": "Parts('OR:wt.part.WTPart:223298')",
"TargetPart@odata.bind": "Parts('OR:wt.part.WTPart:223298')",
"TargetPath": "",
"UpstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:221563')",
"DownstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:221567')"
},
"Views": [
"Plant2"
],
"ChangeOid": ""
}
The request copies the specified parent parts along with their child parts to the specified root part in the downstream view. The request also returns information for all the subcontracted parent and child parts along with the information for the associated plants.
Example: Subcontracting Multiple Parts in the Downstream Structure to the Upstream Structure in the Context of Change
This example shows you how to subcontract two downstream parts to a part in the upstream view in the context of change. This example shows you how to subcontract two downstream parent parts, which have the Plant1 view, to the specified target (upstream) part that has the Plant_02 view, in the context of change. Use the following POST URI with the request body:
URI
POST Windchill/servlet/odata/BomTransformation/SubcontractToPlants
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"DiscrepancyContext": {
"SourceRoot@odata.bind": "Parts('OR:wt.part.WTPart:437588')",
"SourcePartSelection": [
{
"Part@odata.bind": "Parts('OR:wt.part.WTPart:437117')"
},
{
"Part@odata.bind": "Parts('OR:wt.part.WTPart:437610')"
}
],
"TargetRoot@odata.bind": "Parts('OR:wt.part.WTPart:437169')",
"TargetPart@odata.bind": "Parts('OR:wt.part.WTPart:437431')",
"UpstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:197478')",
"DownstreamNavigationCriteria@odata.bind": "NavigationCriterias('OR:wt.filter.NavigationCriteria:197482')"
},
"Views": [
"Plant_02"
],
"ChangeOid": "VR:wt.change2.WTChangeActivity2:437693"
}
The request subcontracts the two downstream parent parts along with their child parts to the specified part in the upstream view. The request adds the parent parts to the Resulting Objects table of the change object specified in the ChangeOid attribute.
You can use the following URI with expands to see details about equivalent links, usage links, upstream parts, downstream parts, and extended data.
URI with Expand
POST Windchill/servlet/odata/BomTransformation/SubcontractToPlants?$expand=EquivalenceLink,UsageLink,UpstreamPart($expand=ExtendedData),DownstreamPart($expand=ExtendedData)