Search code examples
springstate-machinespring-statemachine

Spring State machine - reuse Submachine


I have difficulty in re-using a sub-machine diagram.

I have a need to Re-Use one State machine that I have linked to a state as a sub-machine, in another state as a sub-machine. But when I give the reference to it I get a null pointer exception.

Refer image

enter image description here

I Have added a submachine reference to GeneralTopup, I want to add the same to Register. But it seems impossible. Is this so?


Solution

  • This would not work as you need to have unique states in a whole machine and this would add same state multiple times. Having said that, it is a story what has been in my mind for a long time but I don't yet know how to implement it.