How to rollback the state when encountering errors when I hold multiple Spring Statemachine?

60 Views Asked by At

I have a problem when using the Spring Statemachine, here is the detail:

I create two different statemachines before. However, they are both need to move forward in one transaction according to a new business process.

When the first state moves on successfully, if the second one was failed due to some unexpected issues such as database crashed, then I need to rollback the state of the first one. How can I do it automatically or manually?

Can anyone help?

One way could be helpful. I configure a new event to handle the rollback process. Thus, I don't think that is a graceful way, and if I got more statemachines combination afterwards, I need to config more events?

0

There are 0 best solutions below