cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

API to download Multi Level BOM report as XML?

RK_10318816
1-Newbie

API to download Multi Level BOM report as XML?

I am using Windchill PDMLink Release 11.2 and Datecode with CPS 11.2.0.2

Is it possible to generate Multi level BOM report through API in XML format? We tried using BOMHelper.produceBOMReport(), but its downloading as HTML. We need some help to understand if there is a way to download the report as XML?

2 REPLIES 2

Hello @RK_10318816 

I don't think there is a general API to create BOM report as you need.

 

All exports of MultilevelBOM is done by JSP page from a table menu.

HelesicPetr_0-1663850812105.png

 

I always write own function to create the BOM output in any format I need it.. (xml, csv, html, txt)

 

It is not so complicated to collect all levels of BOM.

 

You can also build your xml format as you need. 

 

I know it doesn't help too much. May be somebody else knows the API which could help.

 

PS> useful api method is 

//primWtp is WTPart object
QueryResult qResult = WTPartHelper.service.getUsesWTParts(primWtp, new LatestConfigSpec());

PetrH

 

 

rhart
13-Aquamarine
(To:RK_10318816)

You could get the multi-level BoM using an infoEngine webject like Query-Tree, then once you have the BoM as i.e convert to xml

 

//String oid = "VR:wt.part.WTPart:651623469";

 

<ie:getService varName="vdb" />

 

<ie:webject name="Query-Tree" type="OBJ">
<ie:param name="instance" data="<%= wtadapterVMName %>" valueSeparator=";" delim=";" default="Windchill" />
<ie:param name="type" data="wt.part.WTPartUsageLink" />
<ie:param name="DIRECTION" data="uses"/>
<ie:param name="ATTRIBUTE" data="number,name,*" delim=","/>
<ie:param name="OUTPUT_TYPE" data="FULL"/>
<ie:param name="MODE" data="NESTED"/>
<ie:param name="GROUP_OUT" data="tree_out"/>
<ie:param name="object_ref" data="<%= oid %>" />
<ie:param name="DEPTH" data="99"/>
</ie:webject>

 

String xmlBOM = vdb.getCollection().toXML();

Announcements