Skip to main content
Jun 6, 2018 9:25 AM UTC
Question

Retrieve Assembly Structure

Hello everyone,

 I need to wite a java custom class that retrieve the structure of an assembly (.asm) file.

The class must be execute in a listener after the CheckIn event.

I have found a call to Swagger REST Api (structure/objects descendants) and it is working on a standalone java class.

 

I wondering if it is possible to call a REST Api inside a java custom class executed at the CheckIn event.

If it is not possible what JAVA API I shoul use for a Windchill 11.0 M030 ?

 

Thankyou

8 replies

Jun 7, 2018 11:59 AM UTC

Hi @gfontana,

If you could share/let us know how did you call Swagger REST Api (structure/objects descendants) from within standalone java class (your standalone example may be), I can play around it to see if we can call it inside check in event listner.

 

Regards,

Shirish

gfontanaAuthor
Jun 7, 2018 12:16 PM UTC

Hi Shirish,  the REST api call is:  

http://<server>:<port>/Windchill/servlet/rest/structure/objects/VR%3Awt.epm.EPMDocument%3A696618/descendantSummaries?criteria=%7B%20%22levels%22%20%3A%201%20%7D

 

where <server> and<port> are valorized with the client data.

 

The java files is in attached 

 

Note: the java class is in progress so probabilly there are some imprecision 

 

Thank you

Jun 6, 2019 4:41 PM UTC

@gfontana 

Try this OData REST API

POST <windchill_server>:<port>/Windchillservlet/odata/ProdMgmt/Parts('part_id')/PTC.ProdMgmt.GetBOM?$expand=Components($expand=Part($select=Name,Number),PartUse,Occurrences) 
CSRF_NONCE: <nonce_value>
Content-Type: application/json

Request Body:
{

}
gfontanaAuthor
Jun 1, 2019 9:34 AM UTC
Thanks for your response.
I also would know the timeline of the swagger REST APi

Thanks
gfontanaAuthor
Jun 1, 2019 9:34 AM UTC
yes thankyou