Skip to main content
4-Participant
July 26, 2021
Question

Unable to fetch EPMBuildRule from EPMDocument

  • July 26, 2021
  • 1 reply
  • 1130 views

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

1 reply

Fadel
23-Emerald I
December 29, 2023

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());
Buiꓘa