The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.
Hi,
currently putting together a custom data utility, and as part of the this I need to check if an EPMDocument has 'owner' link to a WTPart, or alternatively find the EPMDocument which has 'owner' link .
I have tried the following:
However this does not always return the result I expect. If I have 2 EPMDocs associated, and 1 has 'owner' link then great - it works. If I then change that association of the first EPMDoc so that it has link 'content' rather than 'owner' and the second EPMDoc has link 'contributing content', then it return the second EPMDoc. If I then modify the association again to return the first EPMDoc to link type 'owner', it still returns the second EPMDoc which has link type 'contributing content'.
Hopefully that all makes sense?
If so, any ideas what I may be doing wrong?
the entire method I have been using to check for each associated EPMDOc is:
private EPMDocument getCadDoc(WTPart part) throws WTException {
EPMDocument cadDoc = null;
QueryResult cadDocs = WTPartHelper.service
.getDescribedByDocuments(part);
while (cadDocs.hasMoreElements()) {
WTObject obj = (WTObject) cadDocs.nextElement();
if (obj instanceof EPMDocument) {
cadDoc = (EPMDocument) obj;
if (AssociateUtilities.getActiveAssociatedPart(cadDoc).equals(
part)) {
break;
} else {
cadDoc = null;
}
}
cadDoc = null;
}
return cadDoc;
}
Using WC 10.1 M040.
Cheers
Solved! Go to Solution.
Simon,
It doesn't look like the APIs used for association are officially supported for customization. Because of that, anything you try is not guaranteed to work and cannot be supported by PTC tech support. With that said, I found this incomplete code snippet that may be helpful. I've not tested it out so, again, no guarantees....
//Get WTPart instance associated with EPMDocument
WTPart part=...;
Simon,
It doesn't look like the APIs used for association are officially supported for customization. Because of that, anything you try is not guaranteed to work and cannot be supported by PTC tech support. With that said, I found this incomplete code snippet that may be helpful. I've not tested it out so, again, no guarantees....
//Get WTPart instance associated with EPMDocument
WTPart part=...;