Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
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
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
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
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: { }
I am not sure about the support timeline. However, I see a lot of new OData based APIs being exposed. I think you should start using the OData based APIs.