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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Is there a way to delete a WTDocument using an execute expression within a workflow?

bwilcox
12-Amethyst

Is there a way to delete a WTDocument using an execute expression within a workflow?

We automatically create WTDocument PDF copies of promoted and published EPM Documents, and I would like to keep the lifecycle state of the WTDocument the same as the state of the associated EPM Document. The post-publish delegates won't update the state after initial creation, so I am figuring that maybe I could delete the existing PDF document during the promotion request workflow so that after promotion, when the EPM Document gets published at the new state, a new WTDocument will get created and show the correct, promoted state. Does anyone know how to delete an object using code within a workflow execute expression robot?

I am running Windchill 10.2 M030.

ACCEPTED SOLUTION

Accepted Solutions
hlinseisen
12-Amethyst
(To:bwilcox)

PersistenceHelper.manager.delete((Persistable)theDoc);

View solution in original post

3 REPLIES 3

You will need to create a workflow robot (it is a static method you can call from a workflow expression)

Then you can code in java your process (get the document, delete it and update it)

hlinseisen
12-Amethyst
(To:bwilcox)

PersistenceHelper.manager.delete((Persistable)theDoc);

bwilcox
12-Amethyst
(To:hlinseisen)

Thank you for the assistance. This worked just as I needed it to.

Announcements


Top Tags