Task to delete pdf when changing state

I currently have a task that generates a pdf when moving a file to release state.  I need a task that will delete a pdf from the vault when taking a file out of the release state.  Can anyone help me with this?

SolidworksSolidworks Pdm/enterprise Pdm