I've got a process something like a workflow, assume it like this:
- Prepare
- Eat
- Take your stuff to bin
- Clean up the table
Now what I want to do is even the user cancels the "Eat" event I want them to "Clean up the table" same goes for "Prepare" and "Take your stuff to bin" stages.
Currently in my implementation I had to do several checks and sometimes I end up like calling "Clean up table" twice, and some other branching issues when I add couple of more steps.
Is there any well defined design pattern to deal with this kind of flows? (AFAIR there was one I just can't recall the name of it.)