Updating Attributes of MPMStdCCUsageToResourceLinks
To update the out of the box (OOTB) attributes of an existing MPMStdCCUsageToResourceLink object, you must first check out the Operation object with which it is associated. You can also update modeled and all other types of attributes, including IBAs such as enumerated lists.
If you perform Undo Checkout on the Operation object, the changes are rolled back. When you update the MPMStdCCUsageToResourceLink object, the version of the associated Operation will be iterated upon checking it in. To update the MPMStdCCUsageToResourceLink object, you must specify the link OID in the request body.
To update an attribute, you must specify the value with its valid internal name. If a constraint is applied to the attribute, you must specify the internal name of the value specified in the constraint.
If you want to clear the value of an attribute, you can specify its value as null in the request.
If you do not specify an attribute in the request body, then the attribute retains its existing value.
Example: Updating Attributes of an MPMStdCCUsageToResourceLink Object
This example shows you how to update the attributes of an MPMStdCCUsageToResourceLink object specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/UpdateMPMStdCCUsageToResourceLinks
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"stdCCUsageToResourceLinks": [
{
"ID": "OR:com.ptc.windchill.mpml.pmi.MPMStdCCUsageToResourceLink:262568",
"CustomAttribute": "test",
"UsageRate": 0,
"stepUsageRate7": 0,
"stepUsageRate4": 0,
"stepUsageRate2": 0,
"stepUsageRate5": 0,
"Quantity": 0,
"stepUsageRate8": 0,
"stepUsageRate1": 0,
"Unit": {
"Value": "kg"
},
"stepUsageRate3": 0,
"stepUsageRate6": 0,
"scheduled": false
}
]
}
Example: Updating Attributes of Multiple MPMStdCCUsageToResourceLink Objects
This example shows you how to update the attributes of two MPMStdCCUsageToResourceLink objects specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/UpdateMPMStdCCUsageToResourceLinks
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"stdCCUsageToResourceLinks": [
{
"ID": "OR:com.ptc.windchill.mpml.pmi.MPMStdCCUsageToResourceLink:262568",
"UsageRate": 0,
"stepUsageRate7": 0,
"stepUsageRate4": 0,
"stepUsageRate2": 0,
"stepUsageRate5": 0,
"Quantity": 0,
"stepUsageRate8": 0,
"stepUsageRate1": 0,
"Unit": {
"Value": "kg"
},
"stepUsageRate3": 0,
"stepUsageRate6": 0,
"scheduled": false
},
{
"ID": "OR:com.ptc.windchill.mpml.pmi.MPMStdCCUsageToResourceLink:262553",
"UsageRate": 1,
"stepUsageRate7": 1,
"stepUsageRate4": 1,
"stepUsageRate2": 1,
"stepUsageRate5": 1,
"Quantity": 1,
"stepUsageRate8": 1,
"stepUsageRate1": 1,
"Unit": {
"Value": "l"
},
"stepUsageRate3": 0,
"stepUsageRate6": 0,
"scheduled": false
}
]
}