Can I end or cancel a ProcessInstance while running?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2011 12:25 AM
Can I end or cancel a ProcessInstance while running?
In my system, I need to end or cancel a processInstance whenever a task returned error. But it's so ugly a workflow if I connect every task to the errorEnd node.
How can I do it ?
Thanks
In my system, I need to end or cancel a processInstance whenever a task returned error. But it's so ugly a workflow if I connect every task to the errorEnd node.
How can I do it ?
Thanks
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2011 03:25 AM
You can use the RuntimeService to end a workflow, using deleteProcessInstance, where you can provide a reason. The process will end, and if you wish, you can add an execution-listener (to process end) to cleanup some resources for example, after the process ended. In the listener you can inspect the deleteReason, so you can act accordingly.
