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

API to get WTPartRequest associated with WTPart

Participant

API to get WTPartRequest associated with WTPart

Hi All,

Need to fetch all the WTPartRequest attached to a WTPart. If you have ready code available then please suggest.

Thanks

Sitanshu

2 REPLIES 2

Re: API to get WTPartRequest associated with WTPart

Hi @Sitanshu ,

Try using below snippet. I used this way before and sure if this is same API for latest WC release.

But it is worth to try this for latest release too:

 

WTCollection requests = new WTHashSet();
WTPartMaster master = (WTPartMaster)part.getMaster();
long partMasterId = master.getPersistInfo().getObjectIdentifier().getId();
QuerySpec qs = new QuerySpec();
int ind = qs.appendClassList(WTPartRequest.class, true);
qs.appendWhere(new SearchCondition(WTPartRequest.class, WTPartRequest.RESULTING_PART_MASTER_REFERENCE + '.' + WTAttributeNameIfc.REF_OBJECT_ID, new long [] {partMasterId}), new int[]{ind});
QueryResult qr = PersistenceHelper.manager.find(qs);

I hope this helps you.

 

Regards,

Shirish

Highlighted

Re: API to get WTPartRequest associated with WTPart

Thanks. But, I need related parts information. Untitled.png