We just started using Mule a month back and so far it's been a good learning. Right now, we have quite a few flows implemented that integrates our disparate systems. One of the requirements for us is to execute at the end of each flow some clean-up code. More like a finalizer construct.
I am looking for a generic approach that I can follow for all our flows.
Note - If i add a step (where i can execute the clean-up code) to the end of a flow - there is no guarantee that that step will be executed after the completion of all previous steps (as some of the steps are run on different threads; and we don't want to run the entire flow on one synchronous thread). Is there any eventing mechanism in Mule that notifies subscribers at the completion of all steps in a flow? I am also unsure if mule flow life-cycle will be a right fit here. Please help.
Thanks.