Unable to fetch EPMBuildRule from EPMDocument
‎Jul 26, 2021
06:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Jul 26, 2021
06:00 AM
Unable to fetch EPMBuildRule from EPMDocument
I have WTPart associated with EPMDocument with Owner link. I want to navigate from EPMDocument to the WTPart via the EPMBuildRule link using following code.
QueryResult result2 = PersistenceHelper.manager.navigate(epmDoc, EPMBuildRule.BUILD_TARGET_ROLE, EPMBuildRule.class, true);
But the query results is always empty.
Tried different values for the second parameter but no result.
Windchill version - 11.2.1
Labels:
- Labels:
-
CAD Data Mgmt
1 REPLY 1
‎Dec 29, 2023
08:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Dec 29, 2023
08:28 AM
would you try this :
ObjectIdentifier oid = ObjectIdentifier.newObjectIdentifier("wt.epm.EPMDocument:xxxx");
EPMDocument epmdoc= (EPMDocument) PersistenceHelper.manager.refresh(oid);
//EPM and Part have association like: Owner, Contributing Image , Content etc..
//Other association is define in EPMBuildRule. So the demo API:
QueryResult br_qr = PersistenceHelper.manager.navigate(epmdoc,EPMBuildRule.BUILD_TARGET_ROLE, EPMBuildRule.class, true);
while(br_qr.hasMoreElements()) {
parts.add((WTPart)br_qr.nextElement());
}
//The Content association is define in EPMDescribeLink. So the demo API:
QueryResult dl_qr = PersistenceHelper.manager.navigate(epmdoc,EPMDescribeLink.DESCRIBES_ROLE, EPMDescribeLink.class, true);
while(dl_qr.hasMoreElements()) {
parts.add(dl_qr.nextElement());
Fede