Get Related WTPart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Get Related WTPart
I am trying to retrieve the WTPart(s) related to an EPMDocument and WTDocument. I have the code given the WTPart to find the related EPM and WTDocs, however cannot go in the other direction. Anyone have a sample to get me started?
Thanks,
James Little
- Labels:
-
Other
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
James,
Use following to get WTParts related to EPMDocument (works in 9.1 M40).
//get WTParts with active and passive links
//assuming epmDoc is a EPMDocument object
QueryResult wtpart1QR = PersistenceHelper.manager.navigate(epmDoc, EPMBuildRule.BUILD_TARGET_ROLE, EPMBuildRule.class, true);
while (wtpart1QR.hasMoreElements()){
WTPart wtp1 = (WTPart) wtpart1QR.nextElement();
System.out.println("WTPart : " + wtp1.getDisplayIdentity());
}
QueryResult wtpart2QR = PersistenceHelper.manager.navigate(epmDoc, EPMDescribeLink.DESCRIBES_ROLE, EPMDescribeLink.class, true);
while (wtpart2QR.hasMoreElements()){
WTPart wtp2 = (WTPart) wtpart2QR.nextElement();
System.out.println("WTPart : " + wtp2.getDisplayIdentity());
}
Yogesh Bagul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Yogesh,
I am trying to retreive EPM related drawing. Do you have this code.
Thanks,
Serdar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Serdar
You can use below code to get the drawings related to EPMDocument.
EPMDocument document ;
QueryResult relatedDrawings = PersistenceHelper.manager.navigate(document.getMaster(), EPMReferenceLink.REFERENCED_BY_ROLE, EPMReferenceLink.class, true);
System.out.println("getting related drawing" + document.getIdentity() + "====" + relatedDrawings.size());
while (relatedDrawings.hasMoreElements()) {
System.out.println("Drawing --- >>"+ relatedDrawings.nextElement());
}
Hope this helps !!!
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Shreyas,
Thank you very much for your help.
Serdar
