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

