The Alfresco workflow service (and the RESTful API) distinguish between cancelling a workflow instance and deleting a workflow instance. But what is the difference in practice?
The WorkflowInstanceDelete web script and the Workflow REST API wiki page don’t explain, and the WorkflowService JavaDoc just says (about delete):
NOTE: This will force a delete, meaning that the workflow instance may
not go through all the appropriate cancel events.
What cancel events does this refer to? Are there any other differences?
The difference is as far as I know is that by cancelling/ending it doesn’t ‘delete’ the workflow.
If you delete the workflow, the workflow instance physically gets deleted. So no data is present any more and doesn’t process anything which should have happened after the step were you delete it.
If you cancel the workflow, the workflow instance doesn’t gets deleted and it can process an “end” statement. Something like ProcessInstance.end() or an specific end node in your worklow.
Normally I don’t really use this, I use it more on tasks itself rather than on the entire workflow. If I have a transition or something similar then I would just call end or a node before end and do whatever I like.