Skip to main content
10-Marble
August 9, 2023
Solved

How to get Service Effectivity of a Parts List object?

  • August 9, 2023
  • 1 reply
  • 1403 views

I am now working on a customization where I have to create an export of Parts List data in that particular Information Structure based on the Service Effectivities present in the Service Effectivity Filter. When I am trying to get the Service Effectivity of a Parts List object it is giving me zero value though the service effectivities has been defined in it. I was trying to use these methods to get the service effectivity of a Parts List object.

 

Method 1:

ServiceEffectivityDataServiceFactory serviceFactory1 = new ServiceEffectivityDataServiceFactory();
ServiceEffectivityDataService service1 = serviceFactory1.getServiceEffectivityDataServiceDelegate(partsList);
List<Persistable> effectvityonPartandPLItem = service1.getEffectivitiesForPersistable(persistable);

 

Method 2:

QueryResult qr = ServiceEffectivityHelper.service.getEffectivitiesFor(partsList);

 

Could you suggest me what mistake I made or is there any other alternative way to get the service effectivities of a parts list object?

 

 

 

 

 

Best answer by HelesicPetr

Hi @SHRI_HARI 

 

Are the effectivity really from Service ?

 

Try to use an another API to get the standard effectivity 

wt.eff.EffHelper.service.getEffectivity(epm);

 

PetrH

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
August 9, 2023

Hi @SHRI_HARI 

 

Are the effectivity really from Service ?

 

Try to use an another API to get the standard effectivity 

wt.eff.EffHelper.service.getEffectivity(epm);

 

PetrH

SHRI_HARI10-MarbleAuthor
10-Marble
August 11, 2023

Hi HelesicPetr

 

Yes the effectivity is from Service and also when I tried to use this API I got this error.

 

class com.ptc.arbortext.windchill.partlist.PartList cannot be cast to class wt.eff.EffRecordable (com.ptc.arbortext.windchill.partlist.PartList and wt.eff.EffRecordable are in unnamed module of loader 'app')

HelesicPetr
22-Sapphire II
22-Sapphire II
August 14, 2023

Hi @SHRI_HARI 

You should use correct types in the method.

 

Why do you put the PartList to EffRecordable?  

 

The WTPart, or EPMDocument or WTDocument should be used as a input. 

 

PetrH