Updating Multiple Co-produce Objects
You can update single or multiple Co-produce objects or their subtypes and their attributes by specifying the Co-produce OIDs and their attributes in the request body. You can update both modeled and all other types of attributes associated with the Co-produce object. To update a Co-produce object, you must first check out the object. You can update only the latest iteration of a Co-produce object revision.
You can also choose to update the Co-produce object in context of Change (Change Task or Change Notice).
You must have Modify access to the Co-produce and Change objects. You must first reserve the Change object for Edit.
Example: Updating Multiple Co-produce Objects
This example shows you how to update two Co-produce objects specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/UpdateCoproduces
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Coproduces": [
{
"ID": "OR:wt.part.WTPart:201782",
"NewAttr": "Test1.1",
"SoftAttributeBoolean": true,
"SoftAttributeString": "abc"
},
{
"ID": "OR:wt.part.WTPart:201783",
"NewAttr": "Test1.2",
"SoftAttributeBoolean": false,
"SoftAttributeString": "test"
}
]
}
Example: Updating Multiple Co-produce Objects in Context of Change
This example shows you how to update two Co-produce objects in context of Change object specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/UpdateCoproduces
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Coproduces": [
{
"ID": "OR:wt.part.WTPart:201782",
"NewAttr": "Test1.1",
"SoftAttributeBoolean": true,
"SoftAttributeString": "abc",
"ResultedByObjects@odata.bind": [
"ChangeItems('VR:wt.change2.WTChangeOrder2:200982')"
]
},
{
"ID": "OR:wt.part.WTPart:201783",
"NewAttr": "Test1.2",
"SoftAttributeBoolean": false,
"SoftAttributeString": "test",
"ResultedByObjects@odata.bind": [
"ChangeItems('VR:wt.change2.WTChangeOrder2:200982')"
]
}
]
}
The request adds each modified Co-produce object as a Resultant object to the specified Change object.
URI with Expand on ResultedByObjects
POST /Windchill/servlet/odata/BomTransformation/UpdateCoproduces?expand=ResultedByObjects