When trying to delete a business process we get the error :
"Error.Unable to delete Process as it is involved in jobs"
A business process cannot be deleted while there is a job from this process in system.
This is expected as even though the job has been completed and archived, the associated process version still needs to exist as we can still potentially restart the finished job again (i.e. access the job from Find Jobs > Properties > View Job > Restart at activity).
Therefore the only way to delete a process version is to ensure jobs for this process and version no longer exists in the system (live or finished)
As stated above, all jobs for this process would need to be removed before the business process can be deleted.
This can be achieved via job retention or periodically removing finished jobs from the workspace (although the first option is preferred)
Jobs generated while debugging a process are a special case. Debugging is a development time feature thus we would not expect many debug jobs to be present in the Production environment if any.
In the Development environment those jobs can just be cleared down at any time, for example with the Job Clear Down feature.
A Debug job stays active and isn't archived, therefore it wouldn't get picked up by the Retention Policy task.
So if we want to remove debug jobs, then we must delete them with the supported SDK method PurgeJobsByID() available out of the box by providing the list of job IDs to delete.
Level of Complexity