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

Find drawing referenced WtPart on POST_CHECKIN event

SOLVED
Highlighted
Level 7

Find drawing referenced WtPart on POST_CHECKIN event

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;
 }

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Find drawing referenced WtPart on POST_CHECKIN event

Hi @gfontana,

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

 

Regards,

Shirish

2 REPLIES 2

Re: Find drawing referenced WtPart on POST_CHECKIN event

Hi @gfontana,

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

 

Regards,

Shirish

Re: Find drawing referenced WtPart on POST_CHECKIN event

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