Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC Manufacturing Process Management Domain > Automatically Allocate Parts To an Existing Process Plan From Another Assembly
  
Automatically Allocate Parts To an Existing Process Plan From Another Assembly
Using this request, you can automatically allocate common parts to an existing process plan from an assembly based on the previous allocations of the same parts from other related assemblies of the process plan.
For more information, see the Automatically Allocate Parts to An Existing Process Plan Based On Derived Logic topic in Windchill Help Center.
To allocate common parts from another assembly to the operations of an existing process plan specified in the request URI, you must specify NewAssemblyNavigationCriteria, NewAssembly, and ProcessPlanNavigationCriteria in the request body.
NewAssembly is the assembly from which you want to allocate the common parts to the corresponding operations of the specified process plan.
NewAssemblyNavigationCriteria are the inline navigation criteria of NewAssembly.
You can pass the navigation criteria ID or inline navigation criteria of the specified process plan in the ProcessPlanNavigationCriteria parameter.
The following example shows you how to automatically allocate common parts from a new assembly to the existing operations of the process plan specified in the request URI.
Use the following POST URI with $expand, and the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/ProcessPlans('OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:44148884')/PTC.MfgProcMgmt.BOPAllocateAssembly?$expand=OperationToPartLink
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NewAssemblyNavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"ApplicationName": null,
"ApplyToTopLevelObject": true,
"Centricity": false,
"ConfigSpecs": [
{
"@odata.type": "#PTC.NavCriteria.WTPartStandardConfigSpec",
"WorkingIncluded": true,
"View": "Design",
"LifeCycleState": null,
"Variation1": null,
"Variation2": null
}
],
"Filters": [],
"HideUnresolvedDependents": false,
"SharedToAll": false,
"UseDefaultForUnresolved": false
},
"NewAssembly": {
"ID": "OR:wt.part.WTPart:196943"
},
"ProcessPlanNavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"ApplicationName": null,
"ApplyToTopLevelObject": false,
"Centricity": false,
"ConfigSpecs": [
{
"@odata.type": "#PTC.NavCriteri.WTPartStandardConfigSpec",
"WorkingIncluded": true,
"View": "Design",
"LifeCycleState": null
}
],
"Filters": [],
"HideUnresolvedDependents": true,
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
}
The request returns the OperationToPartLink objects created between existing operations and the parts allocated from the new assembly.
The following POST request returns the newly created OperationToPartLink objects along with details of the operations and newly allocated parts.
URI with Expand
POST /Windchill/servlet/odata/MfgProcMgmt/ProcessPlans('OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:44148884')/PTC.MfgProcMgmt.BOPAllocateAssembly?$expand=OperationToPartLink($expand=OperationHolder,Part)