Deleting Multiple CAD Documents Associated with a Resource
To delete existing single or multiple CAD Documents associated with a resource (Process Material, Skill, Tooling, or Work Center), you must first check out the resource object.
You can delete associated CAD Documents by specifying the resource OID and the EPMDescribeLink OIDs in the request body.
This example shows you how to delete two CAD Documents associated with a Skill object. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/DeleteResourcesAssociations
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"RoleAObject": {
"ID": "OR:com.ptc.windchill.mpml.resource.MPMSkill:199136"
},
"LinksOIDs": [
{
"ID": "OR:wt.epm.structure.EPMDescribeLink:207507"
},
{
"ID": "OR:wt.epm.structure.EPMDescribeLink:207508"
}
]
}
Example: Deleting CAD Documents Associated with a Skill Object in Context of Change
This example shows you how to delete two CAD Documents associated with a Skill in context of a Change object specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/DeleteResourcesAssociations
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"RoleAObject": {
"ID": "OR:com.ptc.windchill.mpml.resource.MPMSkill:199136"
},
"LinksOIDs": [
{
"ID": "OR:wt.epm.structure.EPMDescribeLink:207507"
},
{
"ID": "OR:wt.epm.structure.EPMDescribeLink:207508"
}
],
"ChangeOID": "VR:wt.change2.WTChangeOrder2:207283"
}
The request deletes the links and adds the modified resource (here, Skill) as a Resultant object to the specified Change object.