Skip to main content
13-Aquamarine
December 6, 2023
Solved

How to stop traversing a structure based on part type

  • December 6, 2023
  • 2 replies
  • 3094 views

Hi

We have a requirement to stop traversing a structure in BOM report if the assembly has part type = inseparable or source=buy when generating a BOM report. The reason is that the buy or inseparable compoents does not have child components in ERP. Can this be done without major customizations?

Best answer by HelesicPetr

Hi @Hari_Vara 

Do you men this attribute?

HelesicPetr_0-1701954973610.png

because OOTB "Collapsible Assembly" does not exists on a WTPart in the PDMLink

If I set this attribute to yes, the report still shows the child components.

Multilevel BOM and Multilevel component report do the same as before the change

 

PS> it is related to BOM Transformer and Variants not the BOM Reporting. 

Collapsible Attribute Set to Yes

Collapsible Attribute Set to No

 

PetrH

2 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
December 6, 2023

Hello @Pekholm 

the system allows you just exclude a gathering parts from the report by preference Filter Gathering Parts

HelesicPetr_0-1701854335392.png

As I know there is only a way and it is customization. 

for your interest following classes could be customized to achieve what you really need.

MultiLevelBOMReportTreeBuilder.class

PartReportTreeHandler.class

You can extend MultiLevelBOMReportTreeBuilder class with own one and overwrite buildComponentData

 

 public Object buildComponentData(ComponentConfig var1, ComponentParams var2) throws Exception {
 return new PartReportTreeHandler(var2);
 }

 

 

In the MultiLevelBOMReportTreeBuilder buildComponentData is a PartReportTreeHandler where the BOM is collected.

I would create new class, extend the PartReportTreeHandler and rewrite a getNodes where you can filter the children if the parent is your specific type 

 

public Map<Object, List> getNodes(List var1) throws WTException

 

in the method getNodes you would find a place where you can add the condition. 

 

PetrH

Fadel
23-Emerald I
December 6, 2023

Hello Per,

Glad to hear from you again , would you try to set filtering in  PSB before generating the BOM report 

Fadel_0-1701860288801.png

 

 

 

 

Buiꓘa
HelesicPetr
22-Sapphire II
22-Sapphire II
December 6, 2023

Hi @Fadel 

I guess that inseparable is set on the assembly, which should be part of the BOM report. but used parts on the lower level of that assembly shouldn't be part of the BOM report.

 

I know the case and I don't think it is possible to set it by the filter. 

One our customer needed same report with different conditions.  

I wrote own BOM report for him.

 

example what I understood

HelesicPetr_1-1701864222793.png

PetrH