Windchill REST Services Domain Capabilities > Customizing Domains > Extending Domains > Adding Type Extensions of Windchill Types to PTC Domains
Adding Type Extensions of Windchill Types to PTC Domains
A PTC domain can be extended to add an OData entity that corresponds to a custom soft type created in Windchill. Customizers often create a custom soft type extension in Windchill to add a new behavior to Windchill. For example, consider the case where customizers have created a subclass of WTPart. A soft type com.custom.PurchasePart is created for WTPart. Further an additional string attribute called SupplierName on PurchasePart is also added.
To enable this soft type in Product Management domain, customizers first mirror the ProdMgmt domain folder structure in the custom configuration path. Then, create the PurchasePart.json file. Perform the following steps to enable a soft type:
1. In the custom configuration path, create the following folder structure for the Product Management domain at <Windchill>/codebase/rest/custom/domain/:
ProdMgmt
<version>
entity
2. Create the PurchaseParts.json file at <Windchill>/codebase/rest/custom/domain/ProdMgmt/<version>/entity and add the following content in the file:
{
"name": "PurchasePart",
"type": “wcType",
"wcType": “com.custom.PurchasePart",
"collectionName": “PurchaseParts",
"includeInServiceDocument": "false",
"parent": {
"name": "Part"
},
"attributes": [
{
"name": "SupplierName",
"internalName": "SupplierName",
"type": "String"
}
]
}
After the configuration, when you visit the metadata URL for Product Management domain, the new entity PurchasePart, which is derived from the part entity is available. The PurchasePart entity also has the SupplierName property. Since the PurchasePart entity is now in the EDM, standard OData URLs can be used to access PurchasePart.