Stopping a flow on receive of an event

snehapatel
Tera Contributor

I have a flow modelled in flow designer which invokes multiple sub-flows within it. I have a long running flow i.e. the flow takes 3-5 days to complete as it has got some manual tasks as well. I have to model a scenario wherein when a flow is in-execution for a particular request/customer (, I want to stop it on receiving a particular event (say for example cancellation event) and execute another sub-flow or set of actions to undo the actions that has been already executed. Kindly help how to do it.

I am using the Vancouver version

4 REPLIES 4

OlaN
Giga Sage
Giga Sage

Hi,

Have you looked at using the Parallel Flow logic?

This video is helpful, if getting to start with it.

snehapatel
Tera Contributor

This would not work for me because the scenario that I have mentioned in my problem statement is different. Lemme try to explain my problem with the help of a diagram. Please find attached the diagram which is describing the scenario I want to achieve. I need guidance on how stop all the workflows and execute the event workflow on receiving an event.

Seems like a very complex scenario, and will require a lot to get it right.

I first question arises, is the generated event completely separated from the ongoing task in this scenario?

If so, how would the generated event know which of the ongoing Flow that should be cancelled?

 

If the event is driven by some action taken in the task in progress, you should be able to handle the process by checking the result of the subflow, and start another subflow given some specific conditions.

 

There is also a possible way to use the newly created go-back feature in Flow designer (introduced in Vancouver but is not generally available yet).

snehapatel
Tera Contributor

The event is not driven by some action taken in the task in-progress. This scenario could be correlated to the following : Say you have an order processing flow which has sequence of actions and sub-flows. Now a customer places an order which triggers the order processing flow. Now at some point in time customer decides to cancel the order. In this case the order cancellation event would be generated. When this event would be generated, the on-going order processing-flow needs to be stopped (including the sub-flow if it is in-progress) and then execute some of series of actions (like some cancellation actions) that you define (so basically executing the rollback of all the actions/sub-flows that has been already completed/executed for that particular customer order request). I hope this gives you more insight of the scenario.