Creating a Part Alternate Link
A part alternate link is a link between a part and an alternate for that part.
A one-way part alternate link allows only for a single part alternate link between a part and an alternate for that part without a second part alternate link that reverses the two parts.
A two-way part alternate link allows for both, a part alternate link between a part and an alternate for that part with a second part alternate link that reverses the two parts.
Example: Creating a Two-way Part Alternate Link
The following example shows you how to create a two-way part alternate link by specifying the part OID in the request URI, and by specifying the alternate part OID and the TwoWay attribute in the request body. In this example, the value of TwoWay is specified as true. Here, Part11 is a part and Alternate11 is the alternate part.
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:146672')/Alternates
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"AlternatePart@odata.bind": "Parts('OR:wt.part.WTPart:282367')",
"TwoWay": true
}
The request creates a part alternate link between the specified part and alternate part with the StringIBA attribute value as TestValue. It also returns TwoWay as true in the response.
The request silently creates the second alternate link for the reverse alternate link, where the specified Alternate11 OID is the part, Part11 is the alternate part, and does not return its details in the response. The request adds Part11 to the Alternates table of Alternate11 in Windchill.
Example: Creating a One-way Part Alternate Link with Attributes
The following example shows you how to create a one-way part alternate link with an IBA attribute for the part OID specified in the request URI.
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:146672')/Alternates
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"AlternatePart@odata.bind": "Parts('OR:wt.part.WTPart:282367')",
"TwoWay": false,
"StringIBA": "TestValue"
}
The request returns TwoWay as false and creates a part alternate link between the specified part and the alternate part with the StringIBA attribute value as TestValue.
Example: Creating a Two-way Part Alternate Link with Attributes
The following example shows you how to create a two-way part alternate link by specifying the part OID in the request URI, and by specifying the alternate part OID, the IBA attribute, and the TwoWay attribute in the request body. In this example, the value of TwoWay is specified as true. Here, Part11 is a part and Alternate11 is the alternate part.
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:146672')/Alternates
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"AlternatePart@odata.bind": "Parts('OR:wt.part.WTPart:282367')",
"TwoWay": true,
"StringIBA": "TestValue"
}
The request creates a part alternate link between the specified part and alternate part with the StringIBA attribute value as TestValue. It also returns TwoWay as true in the response.
The request silently creates one more alternate link, where the specified Alternate11 OID is the part, Part11 is the alternate part, and does not return its details in the response. The request adds Part11 to the Alternates table of Alternate11 in Windchill.