Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC Product Management Domain > Navigating between Parts and Variant Specification
  
Navigating between Parts and Variant Specification
Consider the sample product family structure as shown in the figure below:
There are two parts Part 1 and Part 2. Each part is associated with two Variant Specifications via two Module Variant Links.
You can navigate from a Part to the Variant Specification via the Module Variant Links using the ModuleVariantInformationLinks navigation property. You can also navigate from a Variant Specification to Part via the Module Variant Link using the ModuleVariantInformationLinks navigation property.
Example: Retrieving Module Variant Link for a Part
This example shows how to retrieve the Module Variant Links associated with a part. Use the following URI with the GET method. If this request is run for Part 1 in the example, the request will return two Module Variant links.
URI
GET /Windchill/servlet/odata/Prodmgmt/Parts/("OR.wt.part.WTPart:404099")?$expand=ModuleVariantInformationLinks HTTP/1.1
Example: Retrieving Module Variant Link for a Part along with Variant Specification
Using the navigation LinkedTo returns the variant specifications associated via the Module Variant Links. Use the following URI with the GET method to retrieve the Module Variant Links along with the Variant Specifications that they link to.
URI
GET /Windchill/servlet/odata/Prodmgmt/Parts/("OR.wt.part.WTPart:404099")?$expand=ModuleVariantInformationLinks($expand=LinkedTo) HTTP/1.1
Example: Retrieving a Module Variant Link for a Variant Specification
For the same sample product family structure, it is also possible to retrieve a part that is associated with a particular variant specification (consider Variant Spec1 in the example) using the following URI with the GET method:
URI
GET /Windchill/servlet/odata/ProdPlatformMgmt/VariantSpecifications/("{Variant Spec1 OID}")?$expand=ModuleVariantInformationLinks HTTP/1.1
The request will return information for one Module Variant Link as there is only link associated with Variant Spec 1
Example: Retrieving a Module Variant Link for a Variant Specification along with Associated Part
For the same example you can use the navigation LinkedFrom to retrieve the part information that is linked from the Variant Specification. Use the following URI with the GET method:
URI
GET /Windchill/servlet/odata/ProdPlatformMgmt/VariantSpecifications/("{Variant Spec1 OID}")?$expand=ModuleVariantInformationLinks($expand=LinkedFrom) HTTP/1.1