Creating Multiple Resource Uses Links
A Resource Uses link exists between a parent resource (Process Material, Skill, Tooling, or Work Center) and the child resource or child part.
You can create single or multiple Resource Uses link (WTPartUsageLink) objects between a parent resource and child resources or child parts. You can add single or multiple resources or parts to a resource by specifying the OIDs of the child resources or child parts along with the required attributes in the request body.
To add single or multiple resources or parts to a resource, you must first check out the parent resource object.
Example: Adding Multiple Resources to a Resource
This example shows you how to add two Skill objects to a parent Skill object by specifying the parent Skill OID in the request URI. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/Resources('VR:com.ptc.windchill.mpml.resource.MPMSkill:209879')/PTC.MfgProcMgmt.CreateUses
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ResourceUses": [
{
"TraceCode": {
"Value": "L"
},
"Unit": {
"Value": "ea"
},
"Quantity": 2,
"FindNumber": "F001",
"LineNumber": 300,
"Uses@odata.bind": "Resources('VR:com.ptc.windchill.mpml.resource.MPMSkill:211136')"
},
{
"TraceCode": {
"Value": "L"
},
"Unit": {
"Value": "ea"
},
"Quantity": 2,
"FindNumber": "F001",
"LineNumber": 310,
"Uses@odata.bind": "Resources('VR:com.ptc.windchill.mpml.resource.MPMSkill:210545')"
}
]
}
The request creates two WTPartUsageLink objects corresponding to the two child resources added to the parent resource.
Example: Adding Multiple Parts to a Resource
This example shows you how to add two parts to a parent Skill object by specifying the parent Skill OID in the request URI. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/Resources('VR:com.ptc.windchill.mpml.resource.MPMSkill:209879')/PTC.MfgProcMgmt.CreateUses
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ResourceUses": [
{
"TraceCode": {
"Value": "L"
},
"Unit": {
"Value": "ea"
},
"Quantity": 2,
"FindNumber": "F001",
"LineNumber": 320,
"Uses@odata.bind": "Parts('VR:wt.part.WTPart:235546')"
},
{
"TraceCode": {
"Value": "L"
},
"Unit": {
"Value": "ea"
},
"Quantity": 2,
"FindNumber": "F001",
"LineNumber": 330,
"Uses@odata.bind": "Parts('VR:wt.part.WTPart:235567')"
}
]
}
The request creates two WTPartUsageLink objects corresponding to the two child parts added to the parent resource.