Skip to main content
1-Visitor
June 6, 2018
Question

Retrieve Assembly Structure

  • June 6, 2018
  • 2 replies
  • 4047 views

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

2 replies

16-Pearl
June 7, 2018

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

gfontana1-VisitorAuthor
1-Visitor
June 7, 2018

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

12-Amethyst
June 6, 2019

@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:
{

}
gfontana1-VisitorAuthor
1-Visitor
June 1, 2019
Thanks for your response.
I also would know the timeline of the swagger REST APi

Thanks
gfontana1-VisitorAuthor
1-Visitor
June 1, 2019
yes thankyou