Create Switch Workflow To Replace State Machine Workflow

  • 11 February 2016
  • 5 replies
  • 3 views

Badge +11

If you have a workflow that has a state machine. How would you use a Switch action to replace the state machine?


5 replies

Userlevel 7
Badge +11

Hey Lisa,

you can't, since a Switch action only evaluates the variable and it goes down a particular branch.  It doesn't let you jump between branches.

Not on it's own anyway happy.png

You could do some funky workflow design where you have a Switch inside a Loop.  That would simulate a State Machine.  But in that example, you might as well use the State Machine.

Vadim

Badge +11

They want us to stay away from the state machines here. They are saying it is slowing down our workflows. I love using the state machine. Now I have to redesign it.

Userlevel 7
Badge +11

ah ok. Then my idea of a switch with a Loop won't help, since both the Loop and State Machine are affected by Safe Looping.

Alternatively, you could mess with the For Each action.  If you planned to have a State Machine that jumped from State1 to State2 to State3 etc, without going backwards, then you could have a Collection variable with 3 items in it.  Use a For Each and depending on the value during each iteration of the For Each, it'd go into the Switch and then go down the appropriate branch.  That would not be affected by Safe Looping.

Vadim

Badge +11

The state machine goes forwards. However, based on rejections or other variables there is a possibility it could go back to a previous state.

Badge +3

Hi. Did you manage to solve this?

Reply