Assigning Plants for a Set of Parts
You can assign one or more plants, to one or more parts using the AssignPlant action. Use the following POST URI with the request body and expand on ExtendedData.
URI
POST /Windchill/servlet/odata/BomTransformation/AssignPlant?$expand=ExtendedData
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "VR:wt.part.WTPart:201999"
},
{
"ID": "VR:wt.part.WTPart:202044"
},
{
"ID": "VR:wt.part.WTPart:202089"
}
],
"plants": [
{
"View": "Brazil",
"@odata.type": "#PTC.MfgProcMgmt.Brazil",
"PhantomManufacturingPart": true
},
{
"View": "Munich",
"@odata.type": "#PTC.MfgProcMgmt.Munich",
"PhantomManufacturingPart": true
},
{
"View": "Manufacturing",
"@odata.type": "#PTC.MfgProcMgmt.PLANTENTERPRISEDATA1",
"PhantomManufacturingPart": true
}
]
}
On success, each plant is assigned to each of the parts. This is a multi object end point — the same request can be made with a single part and multiple plants, or with multiple parts and a single plant.
Example: Assigning Plants for a Set of Parts with Change Information
For the same example above, you can also add a Change Task (or Change Request) to the request body. On success, the Plant objects are available as Resulting Objects in the Change Task. Use the following POST URI with the request body, with the Change Task OID included in the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/AssignPlant?$expand=ExtendedData
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "VR:wt.part.WTPart:201999"
},
{
"ID": "VR:wt.part.WTPart:202044"
},
{
"ID": "VR:wt.part.WTPart:202089"
}
],
"plants": [
{
"View": "Brazil",
"@odata.type": "#PTC.MfgProcMgmt.Brazil",
"PhantomManufacturingPart": true
},
{
"View": "Munich",
"@odata.type": "#PTC.MfgProcMgmt.Munich",
"PhantomManufacturingPart": true
},
{
"View": "Manufacturing",
"@odata.type": "#PTC.MfgProcMgmt.PLANTENTERPRISEDATA1",
"PhantomManufacturingPart": true
}
],
"changeOid": "VR:wt.change2.WTChangeActivity2:195925"
}