Windchill REST Services > Windchill REST Services Domain Capabilities > PTC Domains > PTC BOM Transformation Domain > Actions Available in the BOM Transformation Domain for Creating or Updating Downstream BOMs > GenerateDownstreamStructure
  
GenerateDownstreamStructure
The GenerateDownstreamStructure action by default first matches the specified upstream parent part with its downstream parent part using custom attribute values. The action then transfers the parts in the upstream structure to the downstream using the PasteAsIs action. You can customize the logic by applying the restructuring rules in Windchill in the associativity.properties.xconf file located in Windchill/codebase/com/ptc/core/foundation/associativity.
* 
You can use custom usage attributes and custom part attributes. Ensure that you update or add the properties accordingly in Windchill for performing this action.
To perform this action, an equivalent link must exist between the upstream and downstream root parts.
You can generate a downstream structure for parts under an assembly using an inline or specific upstream and downstream navigation criteria.
You can also generate the downstream structure in the context of change (change task or change notice).
See the Overview of Generate Downstream Structure Action topic in the Windchill Help Center, for more information.
The attributes in the request payload of the GenerateDownstreamStructure action are described in the following table:
Request Attribute
Description
Required
SourceRoot
Attribute in the DiscrepancyContext entity type to specify the root part of the upstream structure.
Yes
SourcePartSelection
Attribute in the DiscrepancyContext entity type to specify the parent part from the upstream structure.
Alternatively, you can specify the path of the parent part.
* 
SourcePartSelection is a collection for specifying a single upstream parent part or its path.
Optional
UpstreamNavigationCriteria
Attribute in the DiscrepancyContext entity type to specify the navigation criteria applied in the upstream.
Yes
DownstreamNavigationCriteria
Attribute in the DiscrepancyContext entity type to specify the navigation criteria applied in the downstream.
Yes
TargetRoot
Attribute in the DiscrepancyContext entity type to specify the root part of the downstream structure.
Optional
TargetPart
Attribute in the DiscrepancyContext entity type to specify the parent part of a downstream structure to which you want to paste the copied parts.
* 
Alternatively, you can specify the path of the downstream parent part, that is, TargetPath to which you want to paste the copied parts.
When you specify the value of a path for the TargetPath attribute, TargetRoot is a required attribute.
Optional
ChangeOid
Attribute to specify the change task or change notice.
Optional
The request, by default, copies the parts from the specified upstream structure and pastes those as is to the downstream or it copies and pastes the parts based on the restructuring rules applied in the custom logic. The request creates new equivalence links between the downstream BOM and the upstream BOM.
POST Windchill/servlet/odata/BomTransformation/GenerateDownstreamStructure
For example, the following is the response:
{
"@odata.context": "$metadata#EquivalentUsageAssociations",
"value": [
{
"UpstreamPartId": "OR:wt.part.WTPart:189986",
"DownstreamPartId": "OR:wt.part.WTPart:189986",
"EquivalenceLinkId": "OR:wt.associativity.EquivalenceLink:190604",
"UsageLinkId": "OR:wt.part.WTPartUsageLink:190605"
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "Europe/Warsaw"
}
The attributes in the response for the GenerateDownstreamStructure action are described in the following table:
Response Attribute
Description
UpstreamPartId
Attribute in a collection that returns the ID of the upstream part which was copied.
DownstreamPartId
Attribute in a collection that returns the ID of the downstream equivalent part.
EquivalenceLinkId
Attribute in a collection that returns the ID of the equivalence link between the upstream part and the downstream equivalent part.
UsageLinkId
Attribute in a collection that returns the ID of the usage link between the downstream parent part and the added downstream part.