State Machine Final transition and Final State

Hi,

what is the difference between putting the final action in the last transition’s action box and the final state entry box?

image
image

VS.

image

The output are the same… so I wonder what are the factors on where to put the last action? Can you provide an example when it will make a difference?
Thanks!

In this example, you are right it doesnt make any difference, however a the purpose of the state machine is to manage complex relationships between different states of the process where it will make a difference. For example in most cases the final state is going to close everything down, and there will likely be multiple transitions which point to it (both in the cases of finishing work, and also in some exception cases) and you would not want to duplicate the sequence in each transition, rather have the transitions all pointing to the same one sequence which is sensible both in terms of saving time, but also debugging etc. Another reason would be that you don’t have sufficient error handling capabilities within the transition itself so it is not wise to perform lots of actions in it. I hope that makes sense!

1 Like