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

WTPartUsage link always gives the latest iteration of child component irrespective of view.

gmydoor-2
10-Marble

WTPartUsage link always gives the latest iteration of child component irrespective of view.

Hi friends,

 

I have a scenario, where BOM structure contains a part  for ex:  ABC 1.46 (As designed) . But the latest iteration of the part is ABC  1.5 ( As manufactured) . Basically this ABC part has 2 views. When i use the below API to query the top part

 

QueryResult links = wt.fc.PersistenceHelper.manager.navigate(validPart, wt.part.WTPartUsageLink.USES_ROLE,wt.part.WTPartUsageLink.class,false);

 

It always gives me latest iteration which is expected. That is, it is giving me ABC  1.5 ( As manufactured).

 

But the BOM structure has link to ABC 1.46 (As designed). Is it possible to get the exact part linked to top part instead of getting the latest part. ( Based on views) .

 

 

ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
22-Sapphire I
(To:gmydoor-2)

Hi @gmydoor-2 

This API works as expected. It always gives you link to the Master object of WTPart and then the latest one. 

You need to use and specify a NavigationCriteria that define what you will get

 

NavigationCriteria navCriteria = new NavigationCriteria();
List<LatestConfigSpec> configSpecList = new ArrayList<LatestConfigSpec>();
configSpecList.add(new LatestConfigSpec());
navCriteria.setConfigSpecs(configSpecList);

QueryResult query = WTPartHelper.service.getUsesWTParts(wtpart,navCriteria);

 

 Example of configSpec

 

LatestConfigSpec
BaselineConfigSpec
WTPartConfigSpec
WTPartEffectivityConfigSpec
AsMaturedConfigSpec
ViewConfigSpec

and many others

 

you can combinate all configSpec in the array and it is solved one by one as is added to the array.  Similar to Structure filter. 

If the first config does not solve the specific iteration use next config, atc... 

 

Hope this can help.

 

PetrH

View solution in original post

2 REPLIES 2
HelesicPetr
22-Sapphire I
(To:gmydoor-2)

Hi @gmydoor-2 

This API works as expected. It always gives you link to the Master object of WTPart and then the latest one. 

You need to use and specify a NavigationCriteria that define what you will get

 

NavigationCriteria navCriteria = new NavigationCriteria();
List<LatestConfigSpec> configSpecList = new ArrayList<LatestConfigSpec>();
configSpecList.add(new LatestConfigSpec());
navCriteria.setConfigSpecs(configSpecList);

QueryResult query = WTPartHelper.service.getUsesWTParts(wtpart,navCriteria);

 

 Example of configSpec

 

LatestConfigSpec
BaselineConfigSpec
WTPartConfigSpec
WTPartEffectivityConfigSpec
AsMaturedConfigSpec
ViewConfigSpec

and many others

 

you can combinate all configSpec in the array and it is solved one by one as is added to the array.  Similar to Structure filter. 

If the first config does not solve the specific iteration use next config, atc... 

 

Hope this can help.

 

PetrH

Thanks HelesicPetr. It worked with WTPartStandardConfigSpec. 

Announcements


Top Tags