Windchill REST Services Domain Capabilities > PTC Domains > PTC Product Management Domain > Actions Available in the PTC Product Management Domain
Actions Available in the PTC Product Management Domain
The following actions are available in the PTC Product Management domain:
GetBOM
The action GetBOM returns the bill of materials (BOM) for the product structure. The action is bound to the entity NavigationCriteria, that is, to the filter saved in Windchill.
When you call the GetBOM action, in the request body of the URL, you can specify the ID of the NavigationCriteria. This is the ID of the saved filter you want to use as the filter criteria. If you do not specify the ID of the filter in the request body, then the default filter is used to work with the product structure. Alternatively, you can specify the navigation criteria in the request payload.
This action will be deprecated in a future release of Windchill REST Services. Use the action GetPartStructure instead.
GetBOMWithInlineNavCriteria
The action GetBOMWithInlineNavCriteria returns the bill of materials (BOM) for the product structure. Pass the navigation criteria as the input parameter. The action is bound to the entity NavigationCriteria, that is, to the filter saved in Windchill. You can pass partial representation of the navigation criteria.
If the navigation criteria contains the property ApplyToTopLevelObject, which is set as True, and no qualifying version is found for the top level object, a relevant error message is returned.
For example, the following partial navigation criteria returns the Bill of Material for Manufacturing view that includes working copies of parts.
POST /ProdMgmt/Parts(<oid>)/PTC.ProdMgmt.GetBOMWithInlineNavCriteria
{
"NavigationCriteria": {
"ApplyToTopLevelObject": true,
"ApplicableType": "wt.part.WTPart",
"ConfigSpecs": [
{
"@odata.type": "#PTC.NavCriteria.WTPartStandardConfigSpec",
"WorkingIncluded": true,
"View": "Manufacturing"
}
]
}
}
This action will be deprecated in a future release of Windchill REST Services. Use the action GetPartStructure instead.
GetPartStructure
The action GetPartStructure returns the bill of materials (BOM) for a product structure along with path details for occurrences. The action is bound to the entity NavigationCriteria, that is, to the filter saved in Windchill.
When you call the GetPartStructure action, in the request body of the URL, you can specify the ID of the NavigationCriteria. This is the ID of the saved filter you want to use as the filter criteria. If you do not specify the ID of the filter in the request body, then the default filter is used to work with the product structure. Alternatively, you can specify the navigation criteria in the request payload.
As compared to the GetBOM and GetBOMWithInlineNavCriteria actions, when you call the GetPartStructure action, the following additional URLs are returned:
PathId is the occurrence path of the component part in the BOM structure. The complete path from the root of the BOM structure is returned. This URL can be used in path filters to filter on the specific component.
PVTreeId is the occurrence path of the component part in the viewable file. The complete path from the root of the BOM structure is returned. This URL can be used to work with Visualization tree. For example, in an application you consume this URL and highlight the component in the Visualization tree.
PVParentTreeId is the occurrence path to the parent of the component part in the viewable file. The complete path from the root of the BOM structure is returned.
When you call the GetPartStructure action along with expand on occurrences, the component along with its details is returned as many times as the component is available in the BOM structure.
For example, consider a part A1 which has the following components:
Component C1—Quantity 2 with occurrences R1 and R2
Component C2—Quantity 1 with no occurrences
When you use the GetPartStructure action with occurrences to get the BOM, the following response is returned:
{
"PartName": "A1"
"PartUseId": null,
"Part": {
"ID": "<oid>",
"Name": "A1",
...
},
"PartUse": null,
"Ocurrences": [],
"Components": [
{
"PartName": "C1"
"PartUseId": "<linkoid>",
"PartId": "<pathidofcomponent>",
"PVTreeId": "<treeidfromviz>",
"PVParentTreeId": "<parenttreeidfromviz>",
"Part": {
"ID": "<oid>",
"Name": "C1",
...
},
"PartUse": {
"ID": "<linkoid>",
"Qty": 1,
...
},
"Ocurrence": {
"ID": "<occoid>",
"ReferenceDesignator": "R1"
...
},
"Components": []
},
{
"PartName": "C1"
"PartUseId": "<linkoid>",
"PartId": "<pathidofcomponent>",
"PVTreeId": "<treeidfromviz>",
"PVParentTreeId": "<parenttreeidfromviz>",
"Part": {
"ID": "<oid>",
"Name": "C1",
...
},
"PartUse": {
"ID": "<linkoid>",
"Qty": 1,
...
},
"Ocurrence": {
"ID": "<occoid>",
"ReferenceDesignator": "R2"
...
},
"Components": []
},
{
"PartName": "C2"
"PartUseId": <linkoid>",
"PartId": "<pathidofcomponent>",
"PVTreeId": "<treeidfromviz>",
"PVParentTreeId": "<parenttreeidfromviz>",
"Part": {
"ID": "<oid>",
"Name": "C2",
...
},
"PartUse": {
"ID": "<linkoid>",
"Qty": 1,
...
},
"Ocurrences": [],
"Components": []
}
]
}
GetPartsList
The action GetPartsList returns a consolidated flat list of components for the specified part structure. The action returns:
Number of occurrences, that is, quantity of the component in the part list. Each component is only listed once with a consolidated total quantity.
Unit of the component
To get more details on the components of a part structure, specify the value application/json;odata.metadata=full in the Accept header of the HTTP request. The odata.metadata parameter controls how much information is included in the response. When you specify the value as full, the response includes all the information.
When you specify the OID of the part and Accept header value application/json;odata.metadata=full in the URL request, the action GetPartsList() returns the following information:
OData type for the part component
Quantity of the part component in the specified part structure
Unit of the component
Navigation URL to the part component
You can expand the Part and PartUses navigation properties for more details of the components.
UpdateCommonProperties
The action UpdateCommonProperties edits the common properties of parts. The action is available only if you set the property hasCommonProperties to true in the Parts.json file.
The action must not be called on objects that are checked out.
Common part attributes, Name, Number, EndItem, DefaultUnit, DefaultTraceCode, ConfigurableModule, GatheringPart, Organization, and PhantomManufacturingPart can be edited.