Skip to main content
1-Visitor
January 14, 2019
Solved

Find drawing referenced WtPart on POST_CHECKIN event

  • January 14, 2019
  • 1 reply
  • 3371 views

Hello everyone,

 I have developed this code that find all the WtPart refrenced by a drawing (.drw).

It's works fine on a stand alone Java application , but when I try to do the same on a POST_CHECKIN Listener the code is unable to find the referenced objects.

Is it matter of the calculation link ?

 

Thank you !

 

public static WTPart wtpRetrieveDrawingAssociatedWtPart(EPMDocument epm) throws Exception {
 
  WTPart wtPart = null;
 
  CADAssociatedParts relationship = new CADAssociatedParts();

   relationship.setTypes(CADAssociatedParts.Type.CALCULATED_BUILD);
  List<Object[]> epmDocs = EPMNavigateHelper.navigate(epm, relationship, CollectItem.SEED_ID, CollectItem.OTHERSIDE).getRawResults();
  if(epmDocs != null) {
   for(Object[] objects : epmDocs) {
    for(Object o : objects) {
     if(o instanceof WTPart) {
      WTPart tempPart = (WTPart) o;
      System.out.println("StandardListenService: " + epm.getName() + " WtPart referenced by" + tempPart.getName() + " " + tempPart.getNumber() );
      if(tempPart.isLatestIteration()) {
       if (tempPart.getName().toLowerCase().contains(".asm")) {
       wtPart = tempPart;
       break;
       }
      }
     }
    }
   }
  }
  return wtPart;
 }

Best answer by ShirishMorkhade_238755

Hi @gfontana,

A quick suggestion, can you check and validate for POST_STORE event?

 

Regards,

Shirish

1 reply

16-Pearl
January 14, 2019

Hi @gfontana,

A quick suggestion, can you check and validate for POST_STORE event?

 

Regards,

Shirish

gfontana1-VisitorAuthor
1-Visitor
January 15, 2019

Hi ShirishMorkhade,

I'm sorry for the delay in answer to your suggestion.

Anyway the POST_STORE work fine, so now i'm able to reload all calculated links 

 

Thank you very much

 

Giorgio

10-Marble
July 3, 2019

Hi Giorgio,

 

I am facing the same issue. 

 

I am trying to get the Reference EPMDocuments while checkin the Drawing using the POST_STORE  event.

 

Can I know which API you are using?

 

Thanks,

Hemanth Kumar