Symptoms
When attempting to create a package using PandampD, numerous issues were surfaced.
Diagnoses
Prior to attempting PandampD:
1) The user was able to delete workflows that had running instances, without being warned.
2) The user was able to create new instances of previously deleted workflows and then give them the same name, causing issues.
3) Auto-generated Forms that had Rules referencing deleted or renamed workflows did not update themselves to reflect the changed/deleted workflow references, causing multiple issues.
All of these things contributed to the errors being surfaced at PandampD time.
Resolution
1) The delete Workflow panel has an option for “All versions and running instances” – The customer should have used that if they wanted to trash the entire workflow including the runtime workflow.
2) This issue spawned from the way they deleted. Once again if you don’t use the “All versions and running instances” option K2 will leave the runtime workflow intact and this will leave the Remote Event Receivers (RER) registered hence the old WF was started when items was added for instance.
There is a Feature Request logged to make these two items “foolproof”:
A) When deleting the WorkFlow from the Artefact page we always delete the running instances but give the user the option to keep WorkFlow history.
B) We add the functionality to the Management pages that when you delete a WorkFlow it also checks for existing RER’s and then remove them as well.
C) We register an event on workflow delete which will execute code to remove the RER’s if they exists.
3) Feature Request logged on the Delete panel in K2 Management that checks dependencies on Views and Forms and then warns that your Forms may not function after deleting (renaming should not be an issue as we should use “System Names” and not display names )