Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

SearchCondition to find UsageLink

$
0
0

Hi.

I need to create QuerySpec to find WTPartUsageLink, where parent WTPart has specified state.

Can anyone provide me sample code?

I tried:

QuerySpec querySpec = new QuerySpec(WTPartUsageLink.class);

int linkIndex = querySpec.appendClassList(WTPartUsageLink.class, false);

int partIndex = querySpec.appendClassList(WTPart.class, false);

querySpec.appendJoin(linkIndex, "roleAObjectRef", partIndex);

CompositeWhereExpression where = new CompositeWhereExpression(LogicalOperator.AND);

where.append(new SearchCondition(WTPart.class, WTPart.LIFE_CYCLE_STATE, SearchCondition.EQUAL, "APPROVED"), new int[]{partIndex});

querySpec.appendWhere(where, new int[]{0});

 

I get QueryException that WTPart is not parent for WTPartUsageLink.

What am i doing wrong?

 

Thanks.


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>