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 > GenerateDownstreamStructureFromTemplate
  
GenerateDownstreamStructureFromTemplate
The GenerateDownstreamStructureFromTemplate action generates a downstream structure from an existing downstream part structure or a rules document specified as the downstream template. The action can also generate a downstream structure from multiple downstream templates.
You can also specify a downstream part structure with an associated rules document as the downstream template to generate the downstream structure. When a rules file is associated with the part, the upstream structure is transferred to the generated downstream structure according to the specified rules.
When a rules document is specified as the downstream template, the upstream parts are transferred to the generated downstream structure according to the rules specified in the rules file.
* 
When a rules document is not available, to generate the downstream structure the system considers the properties specified in the associativity.properties.xconf file in Windchill.
You can generate a downstream structure from the specified downstream template using the inline or specific upstream and downstream navigation criteria.
You can also generate a downstream structure from the downstream template 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 GenerateDownstreamStructureFromTemplate action are described in the following table:
Request Attribute
Description
Required
SourceRoot
Attribute in the GDSFromTemplateContext entity type to specify the root part of the upstream structure for transferring the upstream parts to the generated downstream structure based on the rules applied.
Yes
TargetRoot
Attribute in the GDSFromTemplateContext entity type to specify the target (downstream) root node.
Alternatively, you can specify any downstream part that is under the target root node.
Optional
TargetPath
Attribute in the GDSFromTemplateContext entity type to specify the path of the specified target (downstream) part.
* 
When you specify the value of a path for the TargetPath attribute, TargetRoot is a required attribute.
* 
You can optionally specify the value of TargetPath as a solidus (/) if the specified target (downstream) part is same as the target (downstream) root node.
Optional
UpstreamNavigationCriteria
Attribute in the GDSFromTemplateContext entity type to specify the inline or specific navigation criteria applied to the upstream.
Yes
DownstreamNavigationCriteria
Attribute in the GDSFromTemplateContext entity type to specify the inline or specific navigation criteria applied to the downstream.
* 
The same navigation criteria are applied to the generated downstream structure.
Yes
View
Attribute in the GDSFromTemplateInfo collection to specify the downstream view to be used in the transformation.
Yes
BomType
Attribute in the GDSFromTemplateInfo collection to specify the type of downstream BOM being used.
Optional
AlternateBOM
Attribute in the GDSFromTemplateInfo collection to specify an alternate BOM for the transformation.
Optional
DownstreamTemplate
Attribute in the GDSFromTemplateInfo collection to specify the downstream template (part structure or rules document).
Yes
SourcePathSelection
Attribute in the GDSFromTemplateInfo collection to specify the path ID of a parent node in the upstream structure.
You can optionally use a solidus (/) to specify the path for an upstream root node.
Optional
NumberSuffix
Attribute in the GDSFromTemplateInfo collection to specify the suffix for the downstream structure generated from template.
Optional
Folder
Attribute in the GDSFromTemplateInfo collection to specify the location at which you want to generate a downstream structure.
* 
When not specified, the downstream structure is generated at one of the following locations:
Default location. This location is the same as that of the specified upstream root node.
The location set in the Associativity > Downstream Creation > Location preference in Windchill.
Optional
ChangeOid
Attribute to specify the change task or change notice.
Optional
The request generates a downstream structure from the specified downstream template along with transferring the upstream structure or parts to the generated downstream structure based on the properties file or the rules specified in the rules file. The request creates new equivalence links between the generated downstream BOM and the upstream BOM.
POST Windchill/servlet/odata/BomTransformation/GenerateDownstreamStructureFromTemplate
For example, the following is the response:
{
"@odata.context": "http://<host>:<port>/Windchill/servlet/odata/BomTransformation/$metadata",
"value": [
{
"UpstreamPartId": "OR:wt.part.WTPart:537112",
"DownstreamPartId": "OR:wt.part.WTPart:537253",
"EquivalenceLinkId": "OR:wt.associativity.EquivalenceLink:537272",
"UsageLinkId": null
},
{
"UpstreamPartId": "OR:wt.part.WTPart:536935",
"DownstreamPartId": "OR:wt.part.WTPart:537297",
"EquivalenceLinkId": "OR:wt.associativity.EquivalenceLink:537303",
"UsageLinkId": "OR:wt.part.WTPartUsageLink:537304"
},
{
"UpstreamPartId": "OR:wt.part.WTPart:536911",
"DownstreamPartId": "OR:wt.part.WTPart:537277",
"EquivalenceLinkId": "OR:wt.associativity.EquivalenceLink:537283",
"UsageLinkId": "OR:wt.part.WTPartUsageLink:537284"
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "Asia/Kolkata"
}
The attributes in the response for the GenerateDownstreamStructureFromTemplate action are described in the following table:
Response Attribute
Description
UpstreamPartId
Attribute in a collection that returns the ID of the upstream part that was transferred to the generated downstream structure.
DownstreamPartId
Attribute in a collection that returns the ID of the downstream equivalent part in the generated downstream structure.
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 node and the child node added to the generated downstream structure.