cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Unable to fetch EPMBuildRule from EPMDocument

SD
4-Participant
4-Participant

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

1 REPLY 1
Fadel
22-Sapphire I
(To:SD)

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
Top Tags