Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC Manufacturing Process Management Domain > Allocating Resources to an Operation
  
Allocating Resources to an Operation
Example: Allocating a Single Resource to an Operation
This example shows you how to allocate a single resource to a operation. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/Operations('OR:com.ptc.windchill.mpml.processplan.operation.MPMOperation:180939')/OperationToConsumableLinks HTTP/1.1
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"stepUsageRate4": -1,
"stepUsageRate2": -1,
"stepUsageRate5": -1,
"Quantity": 1,
"stepUsageRate8": -1,
"stepUsageRate1": 32323,
"Unit": {
"Value": "ea",
"Display": "each"
},
"stepUsageRate3": 0,
"stepUsageRate6": 0,
"scheduled": false,
"ConsumableResource@odata.bind": "ConsumableResources('OR:com.ptc.windchill.mpml.resource.MPMTooling:180975')"
}
Example: Allocating Multiple Resources to an Operation
In the following example the POST request is used to allocate two resources (Tooling and Skill) to an Operation. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/Operations('OR:com.ptc.windchill.mpml.processplan.operation.MPMOperation:1409933')/PTC.MfgProcMgmt.AssociateConsumableResources HTTP/1.1
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"OperationToConsumableLink": [
{
"Quantity": 1,
"Unit": {
"Value": "ea",
"Display": "each"
},
"scheduled": false,
"ConsumableResource@odata.bind": "ConsumableResources('OR:com.ptc.windchill.mpml.resource.MPMTooling:179631')"
},
{
"Quantity": 1,
"Unit": {
"Value": "ea",
"Display": "each"
},
"scheduled": false,
"ConsumableResource@odata.bind": "ConsumableResources('OR:com.ptc.windchill.mpml.resource.MPMSkill:1411683')"
}
]
}