Updating Co-produce Usage Links
You can update a single or multiple Co-produce usage links for a Co-produce object or its subtype in context of change (change task or change notice). You must first reserve the change object for Edit. The Co-produce usage link exists between a specific version of a Co-produce object and the main part of its child parts.
You can update single or multiple Co-produce usage links for a Co-produce object by specifying the link OIDs and their required and custom attributes in the request body. You can update both modeled and all other types of attributes associated with the link object.
* 
You can update the attributes Quantity, Unit, and Consumption only in the independent co-produce mode when the mpml.coproduce.manageIndependentCoproduce property in the wt.properties file is set to true.
Example: Updating Multiple Co-produce Usage Links for a Co-produce Object in Context of Change
This example shows you how to update two co-produce usage link objects for a Co-produce object in context of change specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/Coproduces('OR:wt.part.WTPart:219939')/PTC.BomTransformation.UpdateCoProduceUsageLinks
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"CoProduceUsageLinks": [
{
"ID": "OR:wt.mpm.coproduce.CoProduceUsageLink:221017",
"LineNumber": 101,
"SoftAttributeBoolean": true,
"ResultedByObjects@odata.bind": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:200613')"
]
},
{
"ID": "OR:wt.mpm.coproduce.CoProduceUsageLink:221018",
"LineNumber": 102,
"SoftAttribute": "test",
"ResultedByObjects@odata.bind": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:200613')"
]
}
]
}
Example: Updating a Co-produce Usage Link for a Co-produce Object in Context of Change
This example shows you how to update a co-produce usage link object for a Co-produce object in context of change specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/Coproduces('OR:wt.part.WTPart:219939')/PTC.BomTransformation.UpdateCoProduceUsageLinks
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"CoProduceUsageLinks": [
{
"ID": "OR:wt.mpm.coproduce.CoProduceUsageLink:219955",
"LineNumber": 102,
"Consumption": "0000001154=8;0000001155=9",
"Quantity": 100,
"Unit": {
"Value": "ea",
"Display": "each"
},
"Category": {
"Value": "mounting"
},
"ResultedByObjects@odata.bind": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:200615')"
]
}
]
}
Was this helpful?