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

How to remove applied Effectivities on Parts using Info*Engine Task?

Bedrock

How to remove applied Effectivities on Parts using Info*Engine Task?

I have parts updated with wrong Effectivities applied, and i want to remove those applied effectivities bulk using Info*Engine task, is there any tasks to remove effectivities?

Tags (1)
6 REPLIES 6

Re: How to remove applied Effectivities on Parts using Info*Engine Task?

No, there is no webject to do this kind of thing.

But you can easily use java code within the task.

Highlighted

Re: How to remove applied Effectivities on Parts using Info*Engine Task?

Hi Srinivas Morla,

I had requirement on similar line where my customer wanted to delete/remove only Serial Numbered Effectivity.

Though there isn’t any real support in this case between creating, updating or removing effectivities we were able to remove effectivity (here Serial Numbered Effectivity) using wt.fc.PersistenceHelper.manager.delete((wt.part.ProductSerialNumberEffectivity)serial); API call.

before eff.png

after eff.png

I hope this helps you...

Regards,

Shirish

Re: How to remove applied Effectivities on Parts using Info*Engine Task?

Srinivas,

Bulk deletion of WTPart Effectivity is no problem. But why are you putting the requirement of using an I*E tasks?  Why not write a simple Java method to do this?

Can you explain how you are determining which WTParts you intend to delete the effectivity from?  We need to know this so that we can pass the WTParts to the code.

David

Re: How to remove applied Effectivities on Parts using Info*Engine Task?

Hi David,

I want to delete the effectivity from WTParts that have a specific serial number associated with a particular effectivity context. I have multiple effectivity contexts with the same serial number associated for the same WTPart. Using Shirishkumar Morkhade‌'s API, I can manage to delete all effectivity having the same serial number, irrespective of the context. I want to include the context as part of the deletion criteria, as well.

I agree - I*E webjects may not be the way to go. I am open to Java APIs as well.

Thanks,

Srinivas

Re: How to remove applied Effectivities on Parts using Info*Engine Task?

Hi Shirish,

I want to delete the effectivity based on the context and the serial number. I have seen your API and it deletes all serial numbers associated with all effectivity contexts, rather than those associated with a particular effectivity context. - which is what I am going for.

Any APIs to can help me with that?

Thanks in advance.

Re: How to remove applied Effectivities on Parts using Info*Engine Task?

Srinivas,


Thanks for the additional info.  Now I clearly understand what you want to do.


All of the Effectivitiy dB tables including productsneffectivity (class wt.part.ProductSerialNumberEffectivity) reference both the WTPartMaster and the WTPart branch (version).  So, it you want to delete all effectivities that use a particular number. You write a QuerySpec to find ProductSerialNumberEffectivity that reference the oid of the WTPartMaster. You then pass the QuerySpec to PersistenceHelper to return a QueryResult.  You can then loop thru the QueryResult and delete each ProductSerialNumberEffectivity object.


Keep in mind all Effectivites also reference a wt.eff.EffChangeAudit object.  My testing showed that PersistenceHelper.manager.delete() does not collect these EffChangeAudit objects (which is likely why there is no "Supported" way to delete).  So, rather than leaving them orphaned in the dB I suggest getting them from the ProductSerialNumberEffectivity object, adding both the ProductSerialNumberEffectivity and EffChangeAudit objects to a WTSet and then deleting the set using PersistenceHelper.manager.delete(). This will ensure that either both or neither get deleted which is what you want.


That will get the job done.  If you need more help please contact me via email.

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________ Check out the Windchill Tips Board! We're talking about Whirlpool's use of digital twin, augmented reality, and data-driven design!

The NAVIGATE WORKING GROUP is here! Come innovate with PTC!

Sign up for a Working Group