cancel
Showing results for 
Search instead for 
Did you mean: 

best way to step back in a process

tbee
Champ in-the-making
Champ in-the-making
The workflow I need resembles a "wizard"; it has a number of discrete steps, where a following step can only be made if certain conditions are met. But it is possible to return to a previous step. I was wondering was the best way is to implement this. Suppose that a workflow is at a task "C" and it should return to task "A" (skipping "B"), how to best model / implement this?

I can image using a "goto" process variable which is set to "A" and have reversing flows (on all nodes that allow reversing) check this variable in their conditions: if goto is set but not equal to my name, follow the flow back. But I would need to erase this variable once the destination node is reached, otherwise it would keep looping.

Any suggestions?
1 REPLY 1

tbee
Champ in-the-making
Champ in-the-making
I've now implemented this with an execution variable "goto".

The variable is created in the start event (form) with an empty value.
Each step has the option (form) to set the variable.
Each step has two outgoing flows, one where goto=="" and one where goto!="".

The goto!="" flow goes to a series of connected exclusive gateways.
Each gateway checks if the goto's value is equal to its associated task; if so, the flow is directed to the task, if not, it is forwarded to the next gateway.
The flow that is directing to a task clears the goto variable.
The last gateway unconditionally directs to the first task.

It was not possible to attach a screenshot to this comment.