Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC BOM Transformation Domain > Adding Co-produce Usage Links
  
Adding Co-produce Usage Links
You can add a single or multiple Co-produce usage links to a single or multiple Co-produce objects only in the independent co-produce mode.
* 
Independent co-produce mode is enabled when the mpml.coproduce.manageIndependentCoproduce property in the wt.properties file is set to true.
You can add one or more co-produce usage parts by specifying the co-produce OIDs and co-produce usage part OIDs in the request body.
* 
You can only add part OIDs as the co-produce usage part OIDs.
You cannot add the part OIDs of Made From Set or Co-produce objects as co-produce usages.
You cannot add primary and secondary Co-produce objects as co-produce usages.
You can also choose to add the co-produce usage parts in context of change (change task or change notice). You must first reserve the change object for Edit.
Example: Adding Multiple Co-produce Usage Links to Multiple Co-produce Objects
This example shows you how to add two co-produce usage parts to each of the two Co-produce objects specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/AddCoproduceUsages
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"CoproduceUsageMembersAssociations": [
{
"Coproduce": {
"ID": "OR:wt.part.WTPart:195193"
},
"UsageMembers": [
{
"ID": "OR:wt.part.WTPart:194357"
},
{
"ID": "OR:wt.part.WTPart:194387"
}
]
},
{
"Coproduce": {
"ID": "OR:wt.part.WTPart:195284"
},
"UsageMembers": [
{
"ID": "OR:wt.part.WTPart:194116"
},
{
"ID": "OR:wt.part.WTPart:194316"
}
]
}
]
}
Example: Adding Multiple Co-produce Usage Links to a Co-produce Object in Context of Change
This example shows you how to add two co-produce usage parts to 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/AddCoproduceUsages
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ChangeOid": "VR:wt.change2.WTChangeActivity:363673",
"CoproduceUsageMembersAssociations": [
{
"Coproduce": {
"ID": "OR:wt.part.WTPart:195193"
},
"UsageMembers": [
{
"ID": "OR:wt.part.WTPart:194357"
},
{
"ID": "OR:wt.part.WTPart:194387"
}
]
}
]
}